Update nginx configuration

Add location directive for generic /.well-known handling

Remove rewrite directives because redirect option returns a 302 status code, which is inconsistent.

Signed-off-by: Nick Nhien <nnhien@protonmail.com>
This commit is contained in:
Nicholas Nhien
2021-06-19 20:46:06 -07:00
committed by Ferdinand Thiessen
parent 570ddb6e23
commit 3822ee6554

View File

@@ -118,6 +118,7 @@ HAProxy
NGINX
^^^^^
If using nginx as Nextcloud's webserver from behind another nginx reverse proxy, put this only in the reverse proxy's configuration.
::
location /.well-known/carddav {
@@ -127,13 +128,10 @@ NGINX
location /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
or
::
rewrite ^/\.well-known/carddav https://$server_name/remote.php/dav/ redirect;
rewrite ^/\.well-known/caldav https://$server_name/remote.php/dav/ redirect;
location ^~ /.well-known {
return 301 $scheme://$host/index.php$uri;
}
When using NGINX Proxy Manager, the entry ``proxy_hide_header Upgrade;`` must be added in the *"Advanced Settings"*
of the proxy host under *"Custom Nginx Configuration"*, otherwise mobile devices (iPad, iPhone etc.) will simply receive the Error Message "Connection Closed".