0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/davis: fix nginx conf's well-known redirect

We mistakenly used a non-existing nginx variable for the X-Forwarded-Proto causing
the well-known redirect to return erroneous Location headers like:

    Location: ://dav.example/dav

instead of the correct:

    Location: https://dav.example/dav
This commit is contained in:
Casey Link 2024-09-19 11:55:09 +02:00
parent 633f993d9c
commit 5b64b4072a
No known key found for this signature in database
GPG key ID: 8865AA3A7BD80355

View file

@ -493,7 +493,7 @@ in
}; };
"~* ^/.well-known/(caldav|carddav)$" = { "~* ^/.well-known/(caldav|carddav)$" = {
extraConfig = '' extraConfig = ''
return 302 $http_x_forwarded_proto://$host/dav/; return 302 https://$host/dav/;
''; '';
}; };
"~ ^(.+\.php)(.*)$" = { "~ ^(.+\.php)(.*)$" = {
@ -505,7 +505,7 @@ in
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param X-Forwarded-Proto $http_x_forwarded_proto; fastcgi_param X-Forwarded-Proto https;
fastcgi_param X-Forwarded-Port $http_x_forwarded_port; fastcgi_param X-Forwarded-Port $http_x_forwarded_port;
''; '';
}; };