From 684de3bfc7168d129577ef6bb1c4825daafc3835 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Mon, 5 Feb 2024 12:46:45 +0000 Subject: [PATCH] dont use reversed Host header for files services --- reverse-proxy/gen-caddyfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reverse-proxy/gen-caddyfile.py b/reverse-proxy/gen-caddyfile.py index 8529e37..cd7fba3 100755 --- a/reverse-proxy/gen-caddyfile.py +++ b/reverse-proxy/gen-caddyfile.py @@ -165,8 +165,10 @@ def should_protect(self) -> bool: {{subdomain}}.{$FQDN}:80, {{subdomain}}.{$FQDN}:443 { tls internal log - reverse_proxy files:80 - rewrite * /{{folder}}/{path}?{query} + reverse_proxy files:80 { + rewrite /{{folder}}/{path}?{query} + header_up Host {upstream_hostport} + } handle_errors { respond "HTTP {http.error.status_code} Error ({http.error.message})" }