WSGIScriptAlias

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

WSGIScriptAlias /app /home/ubuntu/project/settings/wsgi.py

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_pass http://127.0.0.1:8000;
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
http://localhost:8000/admin

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?

Thanks,
Pradip P Caulagi

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs