1. The problem I’m having:
I am setting up a reverse proxy in dev environment to direct all calls to localhost:9000/services/* to localhost:8080/services/*. The upstream host redirects occasionally to another URL on the same upstream host (say call to localhost:8080/services/A redirects to localhost:8080/services/B). The response code is 503 and the URL is in Location header. Based on my understanding the Location URL is supposed to be rewritten to point to the reverse proxy hostport (ocalhost:8080/services/B to localhost:9000/services/B) automatically. That is not happening. Contents of Location (localhost:8080/services/B) is making it to the client as is. What am I doing wrong? If it needs to be explicitly overwritten, how do I do it?
2. Error messages and/or full log output:
There is no error message but the Location header is not overwritten
"Location": ["http://localhost:8080/services/B"],
3. Caddy version:
v2.8.4
4. How I installed and ran Caddy:
Downloaded Windows executable from Caddy downloads.
a. System environment:
Windows
b. Command:
Caddyfile is in the same folder as the caddy executable
caddy run
c. Service/unit/compose file:
d. My complete Caddy config:
:9000 {
reverse_proxy /services/* :8080
}