forked from Drift/pvv-nixos-config
Compare commits
4 Commits
replace-kn
...
replace-kn
Author | SHA1 | Date | |
---|---|---|---|
fb286be3ec | |||
3fae1f6d4e | |||
18324820f4 | |||
71c86d4267 |
@@ -6,10 +6,8 @@
|
|||||||
addSSL = true;
|
addSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
|
|
||||||
locations = {
|
locations = let
|
||||||
# Proxy home directories
|
proxy_tom = ''
|
||||||
"/~" = {
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_pass https://tom.pvv.ntnu.no;
|
proxy_pass https://tom.pvv.ntnu.no;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
@@ -17,10 +15,12 @@
|
|||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
'';
|
'';
|
||||||
};
|
in {
|
||||||
|
# Proxy home directories
|
||||||
|
"/~".extraConfig = proxy_tom;
|
||||||
|
|
||||||
# Redirect old wiki entries
|
# Redirect old wiki entries - TODO: Move these to the main website
|
||||||
"/disk".return = "301 https://www.pvv.ntnu.no/pvv/Diskkjøp";
|
"= /disk".return = "301 https://www.pvv.ntnu.no/pvv/Diskkjøp";
|
||||||
"/dok/boker.php".return = "301 https://www.pvv.ntnu.no/pvv/Bokhyllen";
|
"/dok/boker.php".return = "301 https://www.pvv.ntnu.no/pvv/Bokhyllen";
|
||||||
"/styret/lover/".return = "301 https://www.pvv.ntnu.no/pvv/Lover";
|
"/styret/lover/".return = "301 https://www.pvv.ntnu.no/pvv/Lover";
|
||||||
"/styret/".return = "301 https://www.pvv.ntnu.no/pvv/Styret";
|
"/styret/".return = "301 https://www.pvv.ntnu.no/pvv/Styret";
|
||||||
@@ -29,25 +29,17 @@
|
|||||||
"/medlemssider/meldinn.php".return = "301 https://www.pvv.ntnu.no/pvv/Medlemskontingent";
|
"/medlemssider/meldinn.php".return = "301 https://www.pvv.ntnu.no/pvv/Medlemskontingent";
|
||||||
"/diverse/medlems-sider.php".return = "301 https://www.pvv.ntnu.no/pvv/Medlemssider";
|
"/diverse/medlems-sider.php".return = "301 https://www.pvv.ntnu.no/pvv/Medlemssider";
|
||||||
"/cert/".return = "301 https://www.pvv.ntnu.no/pvv/CERT";
|
"/cert/".return = "301 https://www.pvv.ntnu.no/pvv/CERT";
|
||||||
"/drift".return = "301 https://www.pvv.ntnu.no/pvv/Drift";
|
"= /drift".return = "301 https://www.pvv.ntnu.no/pvv/Drift";
|
||||||
"/diverse/abuse.php".return = "301 https://www.pvv.ntnu.no/pvv/CERT/Abuse";
|
"/diverse/abuse.php".return = "301 https://www.pvv.ntnu.no/pvv/CERT/Abuse";
|
||||||
"/nerds/".return = "301 https://www.pvv.ntnu.no/pvv/Nerdepizza";
|
"/nerds/".return = "301 https://www.pvv.ntnu.no/pvv/Nerdepizza";
|
||||||
|
"/pvvmud/".extraConfig = proxy_tom;
|
||||||
|
"= /pvvmud".return = "301 $request_uri/";
|
||||||
|
|
||||||
# TODO: Redirect webmail
|
# TODO: Redirect webmail
|
||||||
"/webmail".return = "301 https://webmail.pvv.ntnu.no/squirrelmail";
|
"/webmail".return = "301 https://webmail.pvv.ntnu.no/squirrelmail";
|
||||||
|
|
||||||
# Redirect everything else to the main website
|
# Redirect everything else to the main website
|
||||||
"/".return = "301 https://www.pvv.ntnu.no$request_uri";
|
"/".return = "301 https://www.pvv.ntnu.no$request_uri";
|
||||||
|
|
||||||
# Proxy the matrix well-known files
|
|
||||||
# Host has be set before proxy_pass
|
|
||||||
# The header must be set so nginx on the other side routes it to the right place
|
|
||||||
"/.well-known/matrix/" = {
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Host matrix.pvv.ntnu.no;
|
|
||||||
proxy_pass https://matrix.pvv.ntnu.no/.well-known/matrix/;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -216,19 +216,7 @@ in {
|
|||||||
|
|
||||||
services.redis.servers."".enable = true;
|
services.redis.servers."".enable = true;
|
||||||
|
|
||||||
services.nginx.virtualHosts."matrix.pvv.ntnu.no" = lib.mkMerge [
|
services.nginx.virtualHosts."matrix.pvv.ntnu.no" = lib.mkMerge [({
|
||||||
({
|
|
||||||
locations."/.well-known/matrix/server" = {
|
|
||||||
return = ''
|
|
||||||
200 '{"m.server": "matrix.pvv.ntnu.no:443"}'
|
|
||||||
'';
|
|
||||||
extraConfig = ''
|
|
||||||
default_type application/json;
|
|
||||||
add_header Access-Control-Allow-Origin *;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
})
|
|
||||||
({
|
|
||||||
locations = let
|
locations = let
|
||||||
connectionInfo = w: matrix-lib.workerConnectionResource "metrics" w;
|
connectionInfo = w: matrix-lib.workerConnectionResource "metrics" w;
|
||||||
socketAddress = w: let c = connectionInfo w; in "${c.host}:${toString (c.port)}";
|
socketAddress = w: let c = connectionInfo w; in "${c.host}:${toString (c.port)}";
|
||||||
|
Reference in New Issue
Block a user