1. Output of caddy version
:
2.4.6
2. How I run Caddy:
With caddy file.
a. System environment:
docker
d. My complete Caddy config:
localhost {
rewrite * /slate-easypnr-api-v3{uri}
reverse_proxy easypnr.github.io {
header_up Host {upstream_hostport}
header_up X-Forwarded-Host {host}
}
}
3. The problem I’m having:
Github.io answers caddy with a 302 redirect with a new location. Caddy is returning the URL to the browser instead of following it and returning the end content.
Question: How can I fine control these redirects from the upstream server? Sometimes it will make sense to follow the new location (location in different url), sometimes it does not and I will need to serve the content transparently to the user without taking him to another URL.
I could not find documentation about it.
4. Error messages and/or full log output:
No error.
5. What I already tried:
If I change the upstream url to have https it servers correctly:
I could let it with https, but I want to learn more about caddy and also control better these redirects, because more of this can happen with other websites.
localhost {
rewrite * /slate-easypnr-api-v3{uri}
reverse_proxy https://easypnr.github.io {
header_up Host {upstream_hostport}
header_up X-Forwarded-Host {host}
}
}