From 3822ee6554cb72af45f0a9b5a2110ce13056b32f Mon Sep 17 00:00:00 2001 From: Nicholas Nhien Date: Sat, 19 Jun 2021 20:46:06 -0700 Subject: [PATCH] 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 --- .../reverse_proxy_configuration.rst | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/admin_manual/configuration_server/reverse_proxy_configuration.rst b/admin_manual/configuration_server/reverse_proxy_configuration.rst index e870a19d2ea..4e5d29248d2 100644 --- a/admin_manual/configuration_server/reverse_proxy_configuration.rst +++ b/admin_manual/configuration_server/reverse_proxy_configuration.rst @@ -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".