forked from Drift/pvv-nixos-config
bekkalokk/ingress: proxy matrix well-known files to bicep
This commit is contained in:
parent
d900dc1b1b
commit
1ef033c754
|
@ -38,6 +38,16 @@
|
||||||
|
|
||||||
# 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,7 +216,19 @@ 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)}";
|
||||||
|
|
Loading…
Reference in New Issue