From 9ad9036bd06b02b9a25f2d30adefe7b3f64ef104 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Mon, 16 Dec 2024 23:46:01 +0900 Subject: [PATCH] add access-control-allow-origin --- etc/caddy/Caddyfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/etc/caddy/Caddyfile b/etc/caddy/Caddyfile index dd685f9..18d7caf 100644 --- a/etc/caddy/Caddyfile +++ b/etc/caddy/Caddyfile @@ -10,6 +10,20 @@ www.fogtype.com { redir https://fogtype.com{uri} 308 } net.fogtype.com { + @options { + method OPTIONS + } + + handle @options { + header { + access-control-allow-origin https://headscale.fogtype.com + access-control-allow-methods * + access-control-allow-headers * + } + respond 204 + } + + header access-control-allow-origin https://headscale.fogtype.com reverse_proxy headscale:8080 } mta-sts.fogtype.com {