[mod] caddy: trusted proxies support (#396)

Early preparation for https://github.com/searxng/searxng/pull/4911
This commit is contained in:
Ivan Gabaldon
2025-06-14 15:21:40 +02:00
committed by GitHub
parent 6299a68922
commit 6022367de4

View File

@@ -18,6 +18,15 @@
} }
} }
} }
servers {
client_ip_headers X-Forwarded-For X-Real-IP
# Allow the following IP to passthrough the "X-Forwarded-*" headers to SearXNG
# https://caddyserver.com/docs/caddyfile/options#trusted-proxies
trusted_proxies static private_ranges
trusted_proxies_strict
}
} }
{$SEARXNG_HOSTNAME} {$SEARXNG_HOSTNAME}
@@ -81,11 +90,8 @@ route {
header @static Cache-Control "max-age=31536000, public, immutable" header @static Cache-Control "max-age=31536000, public, immutable"
} }
# SearXNG (uWSGI) # SearXNG
reverse_proxy localhost:8080 { reverse_proxy localhost:8080 {
header_up X-Forwarded-Port {http.request.port}
header_up X-Real-IP {http.request.remote.host}
# https://github.com/searx/searx-docker/issues/24 # https://github.com/searx/searx-docker/issues/24
header_up Connection "close" header_up Connection "close"
} }