summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/surtr/matrix/default.nix16
1 files changed, 10 insertions, 6 deletions
diff --git a/hosts/surtr/matrix/default.nix b/hosts/surtr/matrix/default.nix
index 02e2c7b9..c35153e5 100644
--- a/hosts/surtr/matrix/default.nix
+++ b/hosts/surtr/matrix/default.nix
@@ -81,18 +81,21 @@
81 ]; 81 ];
82 extraConfig = '' 82 extraConfig = ''
83 add_header Strict-Transport-Security "max-age=63072000" always; 83 add_header Strict-Transport-Security "max-age=63072000" always;
84
85 add_header Access-Control-Allow-Origin '*';
86 add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS';
87 add_header Access-Control-Allow-Headers 'X-Requested-With, Content-Type, Authorization';
88 add_header Access-Control-Max-Age 7200;
89 ''; 84 '';
90 locations = { 85 locations = let
86 corsHeaders = ''
87 add_header Access-Control-Allow-Origin '*';
88 add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS';
89 add_header Access-Control-Allow-Headers 'X-Requested-With, Content-Type, Authorization';
90 add_header Access-Control-Max-Age 7200;
91 '';
92 in {
91 "/_matrix".proxyPass = "http://matrix-synapse"; 93 "/_matrix".proxyPass = "http://matrix-synapse";
92 "/_synapse/client".proxyPass = "http://matrix-synapse"; 94 "/_synapse/client".proxyPass = "http://matrix-synapse";
93 "= /.well-known/matrix/server" = { 95 "= /.well-known/matrix/server" = {
94 extraConfig = '' 96 extraConfig = ''
95 default_type application/json; 97 default_type application/json;
98 ${corsHeaders}
96 ''; 99 '';
97 return = "200 '${builtins.toJSON { 100 return = "200 '${builtins.toJSON {
98 "m.server" = "synapse.li:443"; 101 "m.server" = "synapse.li:443";
@@ -101,6 +104,7 @@
101 "= /.well-known/matrix/client" = { 104 "= /.well-known/matrix/client" = {
102 extraConfig = '' 105 extraConfig = ''
103 default_type application/json; 106 default_type application/json;
107 ${corsHeaders}
104 ''; 108 '';
105 return = "200 '${builtins.toJSON { 109 return = "200 '${builtins.toJSON {
106 "m.homeserver" = { "base_url" = "https://synapse.li"; }; 110 "m.homeserver" = { "base_url" = "https://synapse.li"; };