diff --git a/rootfs/nginx/sites-enabled/nginx.conf b/rootfs/nginx/sites-enabled/nginx.conf index 0a93b49..e3527b4 100644 --- a/rootfs/nginx/sites-enabled/nginx.conf +++ b/rootfs/nginx/sites-enabled/nginx.conf @@ -1,7 +1,17 @@ +map $http_x_forwarded_port $nc_port { + default "$http_x_forwarded_port"; + '' "$server_port"; +} + +map $http_x_forwarded_proto $nc_proto { + default "$http_x_forwarded_proto"; + '' "$scheme"; +} + server { listen 8888; root /nextcloud; - + fastcgi_buffers 64 4K; fastcgi_hide_header X-Powered-By; large_client_header_buffers 4 16k; @@ -22,11 +32,11 @@ server { } location = /.well-known/carddav { - return 301 $scheme://$host:$server_port/remote.php/dav; + return 301 $nc_proto://$host:$nc_port/remote.php/dav; } - + location = /.well-known/caldav { - return 301 $scheme://$host:$server_port/remote.php/dav; + return 301 $nc_proto://$host:$nc_port/remote.php/dav; } location / {