Iframe proxy route configuration
Caddy route for iframe-embeddable proxy
// Proxy a web panel at /panel/* to panel-service:8080
const route = buildIframeProxyRoute({
pathPrefix: "/panel",
upstreamHost: "panel-service",
upstreamPort: 8080,
iframeEmbed: true,
});
// Proxy with DNS rebinding bypass (e.g., for mitmweb)
const mitmRoute = buildIframeProxyRoute({
pathPrefix: "/mitmproxy",
upstreamHost: "mitmproxy",
upstreamPort: 8081,
overrideHost: "127.0.0.1:8081",
});
Build a route for proxying a web UI with iframe embedding support
This creates a route that proxies a web interface and optionally adds headers to allow embedding in iframes. Can also override Host/Origin headers for services with DNS rebinding protection.