Welcome! Log In Create A New Profile

Advanced

Multiple reverse proxies that read from /static/ ?

May 08, 2014 03:50PM
Hello,

Sorry for the beginner question, but I can't seem to find an example anywhere that shows how to handle nginx hosting more than one reverse proxy (such as a Django app and an Ipython notebook) where both systems have static files in different directories.

The relevant parts of my nginx conf look something like this -

location /django {
#gunicorn server running on localhost port 8000
proxy_pass http://127.0.0.1:8000/;
}

location /ipython {
#ipython notebook server (tornado) running on localhost port 9999
proxy_pass http://127.0.0.1:9999/;
}

location /static {
alias /opt/django/django_project/static/;
#alias /usr/lib/python2.6/site-packages/IPython/html/static/;
}


Is there a way to specify two different directories of static files or nest a location /static/ inside the other blocks? Intuitively nesting doesn't work, because the css is calling /static, not /ipython/static or /django/static.

My end goal would be to go to http://mysite.com/django/ to see my Django pages and http://mysite.com/ipython/ to get to my ipython notebook server. Either one works right now if I point location /static {} to the appropriate alias, but I don't know how to get both working at the same time.

Thanks in advance.
Subject Author Posted

Multiple reverse proxies that read from /static/ ?

kafonek May 08, 2014 03:50PM

Re: Multiple reverse proxies that read from /static/ ?

Matt Gray May 09, 2014 06:26AM

Re: Multiple reverse proxies that read from /static/ ?

kafonek May 09, 2014 09:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 308
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready