Why am I sometimes logged out of Django Admin?

Since the deployment of my Django website on Digitalocean with Nginx and Gunicorn I have the problem that I either can not log in to the admin panel and he jumps on the registration form again and again or when I am logged in, then only very briefly and then he jumps back again. In between, he also shows the error “Too many redirects”

With this setup, your Django app may not know what the original protocol (http or https) was used to access your site. I’m guessing (you could check your nginx access log to verify/disprove) your site is generating reference urls as http.

When using uWSGI to run Django, there are some headers that need to be passed from nginx to uWSGI - you may need to do something similar for gunicorn.

(It’s hard to tell what the issue may be from just the nginx configuration. For a more detailed look, we’d need to see the gunicorn configuration and possibly your Django project settings.)