marcgibbons / django-rest-swagger

Swagger Documentation Generator for Django REST Framework: deprecated
https://marcgibbons.com/django-rest-swagger/
BSD 2-Clause "Simplified" License
2.59k stars 602 forks source link

Issue with reverse-proxied nginx + uwsgi + django setup #670

Open ramwin opened 7 years ago

ramwin commented 7 years ago

Like this issue. I'm using nginx + uwsgi + django to deploy my project. The nginx is listening port 80, and uwsgi is listening port 81.
client ---> nginx (http://example.com:80) ---> uwsgi-django (http://example.com:81) In most case, if you use these settings:

ALLOWED_HOSTS = ['your_nginx_external_hostname']
USE_X_FORWARDED_HOST=True

this will allow you to send request to the 81 port. However here in my case the request need cookie authentication. Since the request is sent to a different port, the cookie is not sent. So how can I change the setting so that the request will send to http://example.com instead of http://example.com:80/?

ramwin commented 7 years ago

I solved this by using socket instead of http_proxy. But I'm still wondering how to set the host. It would be grateful if any of you can help me.