From defe4ae9b5b05e817838b57785273e88898e6752 Mon Sep 17 00:00:00 2001 From: Younes Date: Fri, 8 Dec 2023 13:48:21 +0100 Subject: [PATCH] add header forward (#262) * change trust proxies directive * add static trusted_proxies --- Caddyfile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Caddyfile b/Caddyfile index 77f274dc..6827535c 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,13 +1,15 @@ +{ + servers { + trusted_proxies static private_ranges + } +} + :80 { + @trpc path_regexp ^/trpc(/|$) + reverse_proxy @trpc localhost:2021 + + @admin path_regexp ^/admin(/|$) + reverse_proxy @admin localhost:4000 - # Reverse proxy directives - reverse_proxy /trpc/* localhost:2021 { - trusted_proxies 172.25.0.0/16 - } - reverse_proxy /admin/* localhost:9000 { - trusted_proxies 172.25.0.0/16 - } - reverse_proxy /* localhost:3000 { - trusted_proxies 172.25.0.0/16 - } + reverse_proxy localhost:3000 }