Pradip Caulagi ppc.lists at
Sun Feb 16 12:27:13 UTC 2014

I want to put my Django application behind Nginx.  I have got it working 
with Apache as -

WSGIScriptAlias /app /home/ubuntu/project/settings/

What is the equivalent of this in Nginx?  I have tried various options 
but nothing works completely.  I currently have -

location /app/ {
   rewrite  ^/app/(.*)  /$1 break;
   proxy_set_header Host $host;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

So my Django project is running on 8000.  I want a request to 
http://localhost/app/admin to be submitted to my project as 

But the Apache rule above and the Nginx rules aren't completely same. 
The POST requests (for admin login) don't work as expected.  My 
impression is that Nginx is getting confused with redirects from Django.

So does anybody know what is the equivalent of the Apache rule above in 
Nginx or what would be the correct way to do this in Nginx?

Pradip P Caulagi

More information about the nginx mailing list