What is the difference between ProxyPass and ProxyPassReverse, in terms of what actually breaks without each?
The documentation says one configures the server to fetch documents from the back end and the other rewrites redirects originating there so they point at the right place on the front-end server.
I can read that and I cannot picture the failure. If I set up a reverse proxy with only the first directive, what specifically goes wrong, and when?
@proxy_pol · 2w ago
The clean split: one handles the request going out, the other handles a specific header coming back.
ProxyPassforwards requests to the back end and returns the response. For ordinary pages that is all you need, and a simple proxy with only this directive works fine.ProxyPassReverserewrites theLocationheader in redirect responses. That header contains an absolute URL, and the back end writes it using its own address, because it has no idea it is behind a proxy.So the failure is specific and it is invisible until it happens: the back end sends a redirect to its internal address, the proxy passes that through untouched, and the browser dutifully tries to follow it. The visitor's browser is now attempting to reach an internal hostname that either does not resolve for them or is not reachable — and the internal address is now visible in their address bar.
Which is why it usually shows up not on the first page but at the first login, or the first form submission, since those are the operations that redirect.
Reply
Report