From 116ae144875e1ac86240ff956614c218a340e0c0 Mon Sep 17 00:00:00 2001 From: Hans van Zijst Date: Wed, 13 Nov 2024 18:02:38 +0100 Subject: [PATCH] Added headers for proxy to enable Element to accept the .well-known stuff. --- matrix/nginx/README.md | 7 +++++++ matrix/synapse/README.md | 1 + 2 files changed, 8 insertions(+) diff --git a/matrix/nginx/README.md b/matrix/nginx/README.md index 10a30b4..4c11fb2 100644 --- a/matrix/nginx/README.md +++ b/matrix/nginx/README.md @@ -66,6 +66,10 @@ server { "org.matrix.msc3575.proxy": {"url": "https://vm02199.procolix.com"} }'; default_type application/json; + + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type, Authorization'; } location /.well-known/matrix/server { @@ -92,6 +96,9 @@ http is forwarded to https. Be sure to substitute the correct values for `server_name`, `base_url` and the certificate files. +The three `add_header` lines are absolutely necessary, but probably need some +tweaking. This is a TODO for this page. + For the actual proxy in front of Synapse, this is what you need: ``` diff --git a/matrix/synapse/README.md b/matrix/synapse/README.md index e227781..acda812 100644 --- a/matrix/synapse/README.md +++ b/matrix/synapse/README.md @@ -171,3 +171,4 @@ Pointing clients to the correct server needs this at Very important: both names (example.com and matrix.example.com) must be A and/or AAAA records in DNS, not CNAME. +See [nginx](../nginx) for details about how to publish this data.