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; } }