Multiple reverse proxies that read from /static/ ?

kafonek nginx-forum at
Thu May 8 19:50:16 UTC 2014


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

location /ipython {
    #ipython notebook server (tornado) running on localhost port 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

My end goal would be to go to to see my Django
pages and 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.

Posted at Nginx Forum:,249943,249943#msg-249943

More information about the nginx mailing list