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 77dba49f9e
commit 6df3c2f6a1

View File

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