From 6df3c2f6a107edf99cc1c87cc9191e37097e7108 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 28 Nov 2019 08:08:30 +0200 Subject: [PATCH] fixed requests to https://domain.com/ redirect to http://domain.com/egroupware/ redirects by Nginx need to use X-Forwarded-Proto too --- doc/docker/nginx.conf | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/docker/nginx.conf b/doc/docker/nginx.conf index 39b0bb554c..62c3b9fd6c 100644 --- a/doc/docker/nginx.conf +++ b/doc/docker/nginx.conf @@ -8,6 +8,12 @@ upstream fpm { server egroupware:9000; } +# redirects needs to use X-Forwarded-Proto too +map $http_x_forwarded_proto $redirectscheme { + default $scheme; + https https; +} + server { access_log off; @@ -105,15 +111,15 @@ server { } # CalDAV & CardDAV autoconfig location ~ ^/.well-known/(caldav|carddav)$ { - return 301 $scheme://$host/egroupware/groupdav.php/; + return 301 $redirectscheme://$host/egroupware/groupdav.php/; } location ~ ^(/principals/users/.*)$ { - return 301 $scheme://$host/egroupware/groupdav.php$1; + return 301 $redirectscheme://$host/egroupware/groupdav.php$1; } # Nginx does NOT use index for OPTIONS requests breakng WebDAV # for Windows, which sends OPTIONS / and stalls on Nginx 405 response! # This also redirects all requests to root to EGroupware. location = / { - return 301 $scheme://$host/egroupware/index.php; + return 301 $redirectscheme://$host/egroupware/index.php; } }