Port proxy for nginx/gunicorn Django Rest Framework app
Changing
proxy_set_header Host $host:8000;
to
proxy_set_header Host $http_host;
in the nginx configuration file seems to have fixed the issue --
Changing
proxy_set_header Host $host:8000;
to
proxy_set_header Host $http_host;
worked for me.
Also I had to add host name to ALLOWED_HOST
field in settings.py
file.
I am using wsgi, nginx and Django.Actually i want to redirect the request on multiple port on same IP address.How to do this.
I have one url, for example "mysite.com". When its called i want server to process request on different port. Every thing will be same like only one instance, same url but server should redirect the request on different port. mysite.com:8080, mysite.com:8001, mysite.com:8002, etc for load balancing. How to do it in nginx.