06 December 2020

Reverse Proxy für domain.org/nextcloud

Reverse Proxy

nginx reverse Proxy: https://domain.org/nextcloud → Reverse Proxy → http://nextcloud.lan/

        location /remote.php {
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://nextcloud.plocki.lan/remote.php;
        }

        location /.well-known/carddav {
                return 301 $scheme://$host/nextcloud/remote.php/dav;
        }

        location /.well-known/caldav {
                return 301 $scheme://$host/nextcloud/remote.php/dav;
        }

        location /nextcloud {
            client_max_body_size 200M;
            add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
            proxy_headers_hash_max_size 512;
            proxy_headers_hash_bucket_size 64;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

            add_header Front-End-Https on;
            # whatever the IP of your cloud server is
            proxy_pass http://nextcloud.plocki.lan;
        }