Files
uncloud/website/Caddyfile
T

33 lines
930 B
Caddyfile

{
admin off
servers {
# Trust the Uncloud ingress Caddy (cluster network) so the X-Forwarded-For chain it forwards
# is preserved and the real client IP is logged in the client_ip field.
trusted_proxies static 10.210.0.0/16
}
}
:8000 {
# Reverse proxy PostHog through our own domain so ad blockers don't drop analytics requests.
# Static assets (e.g. array.js) are served from a separate PostHog assets host.
handle_path /phproxy/static/* {
rewrite * /static{uri}
reverse_proxy https://us-assets.i.posthog.com {
header_up Host us-assets.i.posthog.com
}
}
handle_path /phproxy/* {
reverse_proxy https://us.i.posthog.com {
header_up Host us.i.posthog.com
}
}
root * /usr/share/caddy
# Serve clean URLs for landing pages, e.g. /hub -> hub.html.
try_files {path}.html
file_server
log
}