user1487262
user1487262

Reputation: 21

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

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 ?

Upvotes: 2

Views: 873

Answers (1)

medmunds
medmunds

Reputation: 6251

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.

Upvotes: 1

Related Questions