From fa230cba4e1c4f4d3f5d030efad72a997712892a Mon Sep 17 00:00:00 2001 From: Kyle Kienapfel Date: Wed, 11 Jun 2025 12:42:06 -0700 Subject: [PATCH] fix: have caddy apply url prefix to relative redirects from services Definitely required for autumn, as an example /autumn/attachments/:id: will redirect to /attachments/:id:/:filename: But since we are self-hosting, the requester (client) actually needs to be redirected to /autumn/attachments/:id:/:filename: Speculatively added for the other services Signed-off-by: Kyle Kienapfel --- Caddyfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Caddyfile b/Caddyfile index 64753cf..be9c385 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,22 +1,30 @@ {$HOSTNAME} { route /api* { uri strip_prefix /api - reverse_proxy http://api:14702 + reverse_proxy http://api:14702 { + header_down Location "^/" "/api/" + } } route /ws { uri strip_prefix /ws - reverse_proxy http://events:14703 + reverse_proxy http://events:14703 { + header_down Location "^/" "/ws/" + } } route /autumn* { uri strip_prefix /autumn - reverse_proxy http://autumn:14704 + reverse_proxy http://autumn:14704 { + header_down Location "^/" "/autumn/" + } } route /january* { uri strip_prefix /january - reverse_proxy http://january:14705 + reverse_proxy http://january:14705 { + header_down Location "^/" "/january/" + } } reverse_proxy http://web:5000