Welcome! Log In Create A New Profile

Advanced

WSGIScriptAlias

Pradip Caulagi
February 16, 2014 07:28AM
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

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

WSGIScriptAlias

Pradip Caulagi February 16, 2014 07:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 111
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