replace-knakelibrak-nginx-reverse-proxy #18

Merged
danio merged 3 commits from replace-knakelibrak-nginx-reverse-proxy into main 2023-12-03 07:01:14 +01:00
1 changed files with 5 additions and 8 deletions
Showing only changes of commit d900dc1b1b - Show all commits

View File

@ -2,17 +2,11 @@
{
services.nginx.virtualHosts = {
"www2.pvv.ntnu.no" = {
serverAliases = [ "www2.pvv.org" "pvv.ntnu.no" "pvv.org" ];
addSSL = true;
enableACME = true;
# TODO after updating the corresponding DNS record:
# serverAliases = [ "www2.pvv.org" "pvv.ntnu.no" "pvv.org" ]
serverAliases = [ "www2.pvv.org" ];
locations = {
# Redirect the main website
"= /".return = "301 https://www.pvv.ntnu.no/";
# Proxy home directories
"/~" = {

Please add tryFiles = "$uri $uri/ =404"; to support both slashed and unslashed URLs

Please add `tryFiles = "$uri $uri/ =404";` to support both slashed and unslashed URLs
extraConfig = ''
@ -39,8 +33,11 @@
"/diverse/abuse.php".return = "301 https://www.pvv.ntnu.no/pvv/CERT/Abuse";
"/nerds/".return = "301 https://www.pvv.ntnu.no/pvv/Nerdepizza";
# TODO: Redirect web main
# TODO: Redirect webmail
"/webmail".return = "301 https://webmail.pvv.ntnu.no/squirrelmail";
# Redirect everything else to the main website
"/".return = "301 https://www.pvv.ntnu.no$request_uri";
};
};
};