nixos/invoiceplane: detect HTTP/HTTPS scheme (a bit)

This commit is contained in:
teutat3s 2024-06-24 22:58:37 +02:00
parent 2196ed1427
commit e4a36c87eb
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -404,9 +404,13 @@ in
'';
locations = {
"/setup".extraConfig = ''
rewrite ^(.*)$ http://${hostName}/ redirect;
'';
"/setup".extraConfig =
let
scheme = if config.services.nginx.virtualHosts.${hostName}.forceSSL then "https" else "http";
in
''
rewrite ^(.*)$ ${scheme}://${hostName}/ redirect;
'';
"~ .php$" = {
extraConfig = ''