django-rest-swagger icon indicating copy to clipboard operation
django-rest-swagger copied to clipboard

Duplicated host when using NGINX + GUNICORN

Open otavioarrudasantos opened this issue 5 years ago • 0 comments

Hi, first of all, Thank you for the great job!!

When the NGINX parameter proxy_set_header Host $host; is set, the requested host becames duplicated as follows (original host name replaced by www.example.com):

http://www.example.com,www.example.com/api/company/132/ticket/

I fixed this error by removing the proxy_set_header Host $host;

I'm using djangorestframework==3.6.2 and django-rest-swagger==2.1.2 In my settings.py:

ALLOWED_HOSTS = ['www.example.com']
USE_X_FORWARDED_HOST=True

There is another way to fix this without removing the NGINX configuration?

otavioarrudasantos avatar Nov 12 '18 17:11 otavioarrudasantos