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

Merge pull request #271506 from Misterio77/nginx-redirect-status-code

This commit is contained in:
Ryan Lahfa 2023-12-12 14:05:33 +01:00 committed by GitHub
commit 3bb93fb2cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 8 deletions

View file

@ -377,7 +377,7 @@ let
server_name ${vhost.serverName} ${concatStringsSep " " vhost.serverAliases};
${acmeLocation}
location / {
return 301 https://$host$request_uri;
return ${toString vhost.redirectCode} https://$host$request_uri;
}
}
''}
@ -396,7 +396,7 @@ let
${optionalString (vhost.root != null) "root ${vhost.root};"}
${optionalString (vhost.globalRedirect != null) ''
location / {
return 301 http${optionalString hasSSL "s"}://${vhost.globalRedirect}$request_uri;
return ${toString vhost.redirectCode} http${optionalString hasSSL "s"}://${vhost.globalRedirect}$request_uri;
}
''}
${optionalString hasSSL ''