Login issue behind NGINX reverse proxy

Hi there,

I’ve just finished my very first Nextcloud installation. Everything is running like a charm as long as I stay in my local network.

Unfortunately I’m facing issues when I login remotely via NGINX reverse proxy:

  • On a browser after entering my credentials the “Anmelden” - wheel starts to spin but never stops.
  • If I reload the page, I’m in.

So it seems, that login was successful but something is blocking to leave the login page.

My configuration looks like:

  • Nextcloud runs at home in a jail of a FreeNAS 11.3 system (FreeBSD, Apache2.4, PHP7.3, MariaDB 10.4)
  • NGINX runs in a Digitialocean droplet (Ubuntu 18.04)

My NGINX-Config (warped by certbot) looks like:

server {
#    listen 80 default_server;
#    listen [::]:80 default_server;
       server_name xxx.de www.xxx.de;

       resolver dyndns.securepoint.de valid=10s;

        location  / {

            set $xxx                            http://xxx.spdns.de;
            proxy_pass                            $xxx:8081;
            proxy_set_header Host                 $http_host;
            proxy_set_header X-Real-IP            $remote_addr;
            proxy_set_header X-Forwarded-For      $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto    $scheme;
            proxy_headers_hash_max_size 512;
            proxy_headers_hash_bucket_size 64;
            add_header Front-End-Https on;

        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/xxx.de/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/xxx.de/privkey.pem; # managed by Certbot
         include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
         ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
server {
    if ($host = www.xxx.de) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = xxx.de) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    server_name xxx.de www.xxx.de;
    return 404; # managed by Certbot


Any idea?

Thanks Harald

Problem solved by reading the posts here. :roll_eyes: trusted_proxies in config.php did the trick.
Sorry for bothering.