make reaching the media server from the internal domain work
This commit is contained in:
parent
879d87849b
commit
4ae7615a46
1 changed files with 57 additions and 47 deletions
|
@ -144,54 +144,64 @@ in {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
services.nginx.virtualHosts."matrix.chir.rs" = {
|
services.nginx.virtualHosts = let
|
||||||
sslCertificate = "/var/lib/acme/chir.rs/cert.pem";
|
main = {
|
||||||
sslCertificateKey = "/var/lib/acme/chir.rs/key.pem";
|
sslCertificate = "/var/lib/acme/chir.rs/cert.pem";
|
||||||
locations."/_matrix" = {
|
sslCertificateKey = "/var/lib/acme/chir.rs/key.pem";
|
||||||
proxyPass = "https://matrix.int.chir.rs";
|
locations."/_matrix" = {
|
||||||
proxyWebsockets = true;
|
proxyPass = "https://matrix.int.chir.rs";
|
||||||
extraConfig = ''
|
proxyWebsockets = true;
|
||||||
proxy_ssl_server_name on;
|
extraConfig = ''
|
||||||
proxy_hide_header Access-Control-Allow-Origin;
|
proxy_ssl_server_name on;
|
||||||
add_header Access-Control-Allow-Origin '*' always;
|
proxy_hide_header Access-Control-Allow-Origin;
|
||||||
'';
|
add_header Access-Control-Allow-Origin '*' always;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
locations."/_matrix/media" = {
|
||||||
|
proxyPass = "http://localhost:8008";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_hide_header Access-Control-Allow-Origin;
|
||||||
|
add_header Access-Control-Allow-Origin '*' always;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
locations."/.well-known/matrix/server" = {
|
||||||
|
extraConfig = ''
|
||||||
|
return 200 '{ "m.server": "matrix.chir.rs:443" }';
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
locations."/.well-known/matrix/client" = {
|
||||||
|
extraConfig = ''
|
||||||
|
add_header Access-Control-Allow-Origin '*';
|
||||||
|
return 200 '{ "m.homeserver": { "base_url": "https://matrix.chir.rs" } }';
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
locations."/_synapse/metrics" = {
|
||||||
|
extraConfig = ''
|
||||||
|
return 404 'Not found';
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
locations."/_matrix/media" = {
|
in {
|
||||||
proxyPass = "http://localhost:8008";
|
"matrix.int.chir.rs" = main;
|
||||||
proxyWebsockets = true;
|
"matrix.chir.rs" =
|
||||||
extraConfig = ''
|
main
|
||||||
proxy_hide_header Access-Control-Allow-Origin;
|
// {
|
||||||
add_header Access-Control-Allow-Origin '*' always;
|
sslCertificate = "/var/lib/acme/int.chir.rs/cert.pem";
|
||||||
'';
|
sslCertificateKey = "/var/lib/acme/int.chir.rs/key.pem";
|
||||||
};
|
};
|
||||||
locations."/.well-known/matrix/server" = {
|
"chir.rs" = {
|
||||||
extraConfig = ''
|
locations."/.well-known/matrix/server" = {
|
||||||
return 200 '{ "m.server": "matrix.chir.rs:443" }';
|
extraConfig = ''
|
||||||
'';
|
return 200 '{ "m.server": "matrix.chir.rs:443" }';
|
||||||
};
|
'';
|
||||||
locations."/.well-known/matrix/client" = {
|
};
|
||||||
extraConfig = ''
|
locations."/.well-known/matrix/client" = {
|
||||||
add_header Access-Control-Allow-Origin '*';
|
extraConfig = ''
|
||||||
return 200 '{ "m.homeserver": { "base_url": "https://matrix.chir.rs" } }';
|
add_header Access-Control-Allow-Origin '*';
|
||||||
'';
|
return 200 '{ "m.homeserver": { "base_url": "https://matrix.chir.rs" } }';
|
||||||
};
|
'';
|
||||||
locations."/_synapse/metrics" = {
|
};
|
||||||
extraConfig = ''
|
|
||||||
return 404 'Not found';
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services.nginx.virtualHosts."chir.rs" = {
|
|
||||||
locations."/.well-known/matrix/server" = {
|
|
||||||
extraConfig = ''
|
|
||||||
return 200 '{ "m.server": "matrix.chir.rs:443" }';
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
locations."/.well-known/matrix/client" = {
|
|
||||||
extraConfig = ''
|
|
||||||
add_header Access-Control-Allow-Origin '*';
|
|
||||||
return 200 '{ "m.homeserver": { "base_url": "https://matrix.chir.rs" } }';
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue