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:
commit
3bb93fb2cd
5 changed files with 51 additions and 8 deletions
|
@ -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 ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue