From 10e8ba5569dced1da0cbca5a2aa67c1362841fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Tue, 8 Apr 2025 00:10:29 +0400 Subject: [PATCH] Add missing CORS headers to host-meta.json Otherwise XMPP Web clients cannot fetch the Bosh and WS endpoint info --- .../kosmos_website/templates/nginx_conf_website.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site-cookbooks/kosmos_website/templates/nginx_conf_website.erb b/site-cookbooks/kosmos_website/templates/nginx_conf_website.erb index f9e3024..3622612 100644 --- a/site-cookbooks/kosmos_website/templates/nginx_conf_website.erb +++ b/site-cookbooks/kosmos_website/templates/nginx_conf_website.erb @@ -29,11 +29,15 @@ server { ssl_certificate <%= @ssl_cert %>; ssl_certificate_key <%= @ssl_key %>; + location /.well-known/host-meta.json { + add_header 'Access-Control-Allow-Origin' '*'; + } + <% if @accounts_url %> location ~ ^/.well-known/(keysend|lnurlp|nostr|openpgpkey|webfinger) { proxy_ssl_server_name on; proxy_set_header X-Forwarded-Host $host; - proxy_pass https://accounts.kosmos.org; + proxy_pass <%= @accounts_url %>; } <% end %> }