redirects by Nginx need to use X-Forwarded-Proto too
This commit is contained in:
Ralf Becker 2019-11-28 08:08:30 +02:00
parent 446430ddaf
commit 3e1a9a588d

View File

@ -8,6 +8,12 @@ upstream fpm {
server egroupware:9000; server egroupware:9000;
} }
# redirects needs to use X-Forwarded-Proto too
map $http_x_forwarded_proto $redirectscheme {
default $scheme;
https https;
}
server { server {
access_log off; access_log off;
@ -105,15 +111,15 @@ server {
} }
# CalDAV & CardDAV autoconfig # CalDAV & CardDAV autoconfig
location ~ ^/.well-known/(caldav|carddav)$ { location ~ ^/.well-known/(caldav|carddav)$ {
return 301 $scheme://$host/egroupware/groupdav.php/; return 301 $redirectscheme://$host/egroupware/groupdav.php/;
} }
location ~ ^(/principals/users/.*)$ { 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 # Nginx does NOT use index for OPTIONS requests breakng WebDAV
# for Windows, which sends OPTIONS / and stalls on Nginx 405 response! # for Windows, which sends OPTIONS / and stalls on Nginx 405 response!
# This also redirects all requests to root to EGroupware. # This also redirects all requests to root to EGroupware.
location = / { location = / {
return 301 $scheme://$host/egroupware/index.php; return 301 $redirectscheme://$host/egroupware/index.php;
} }
} }