https://example.com/admin redirects to https://admin in Django Nginx and gunicorn

筅森魡賤 提交于 2019-12-11 00:11:38

问题


The entire application works with Django + Nginx + Gunicorn using SSL(in production). But when I try to access django-admin page by https://example.com/admin and try to login it redirects me to (https://admin).

PS: Sorry for a silly question. Any inputs ?


回答1:


This sounds very similar to Django's HttpResponseRedirect seems to strip off my subdomain.

And if so, the likely issue is that either your nginx proxy or Gunicorn is not delivering the domain name (HTTP_HOST) to Django. Verify by examining request.META within Django.



来源:https://stackoverflow.com/questions/11237023/https-example-com-admin-redirects-to-https-admin-in-django-nginx-and-gunicor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!