You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question] Caddy Forward proxy behind another Caddy reverse proxy? #145
Since modifying our main caddy server is a no-go, will the plugin work if placed behind another caddy reverse proxy? If so how should the forward proxy be configured?
Client --> Caddy A -- reverse proxy --> Caddy B forward proxy --> internet
The client to a forward proxy (Caddy A in your example) needs to support forward proxies. I believe the HTTP(S)_PROXY env var(s) can do this, but I haven't played with this myself.
That's nice, and I admit I missed it while reading the documentation.
However, the forward_proxy_url option is a child of the transport rules of the reverse_proxy directive. AS-IS from the documentation it's my understanding that the option allows to reach a specific upstream through the defined forward proxy url.
My question concern being able to reach any destination through the forward proxy (as any forward proxy usually allows), with the caveat that the forward proxy url to use must point to our main Caddy instance, hence the idea of putting it behind a reverse proxy.
Ideally, in a flexible environment, I would simply spin up a new caddy instance with the forward proxy plugin and bind it to a different WAN IP (so to not disrupt the main Caddy), but that would touch the firewall area complicating more the matter (administratively speaking).
The client to a forward proxy (Caddy A in your example) needs to support forward proxies.
Of course, but luckily many applications have built-in support.
Activity
mholt commentedon Dec 2, 2024
The client to a forward proxy (Caddy A in your example) needs to support forward proxies. I believe the HTTP(S)_PROXY env var(s) can do this, but I haven't played with this myself.
mholt commentedon Dec 2, 2024
Oh actually we have a setting for this in the reverse_proxy: https://caddyserver.com/docs/modules/http.reverse_proxy.transport.http#forward_proxy_url or Caddyfile: https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#forward_proxy_url
maxiride commentedon Dec 3, 2024
That's nice, and I admit I missed it while reading the documentation.
However, the
forward_proxy_urloption is a child of thetransportrules of thereverse_proxydirective. AS-IS from the documentation it's my understanding that the option allows to reach a specific upstream through the defined forward proxy url.My question concern being able to reach any destination through the forward proxy (as any forward proxy usually allows), with the caveat that the forward proxy url to use must point to our main Caddy instance, hence the idea of putting it behind a reverse proxy.
Ideally, in a flexible environment, I would simply spin up a new caddy instance with the forward proxy plugin and bind it to a different WAN IP (so to not disrupt the main Caddy), but that would touch the firewall area complicating more the matter (administratively speaking).
Of course, but luckily many applications have built-in support.
Zetanova commentedon Apr 16, 2026
this resolves for me this issue
#193
I wanted simply route *.local domains without DNS or hosts entries