1. The problem I’m having:
Hello.
I am trying to reverse proxy to an external server (Internet) from LAN.
On that reversy_proxy I need to change the host and referrer headers, but with everything I do I can’t modify these headers.
2. Error messages and/or full log output:
2024/05/02 11:25:20.240 ←[34mINFO←[0m http.log.access handled request {"request": {"remote_ip": "::1", "remote_port": "59955", "client_ip": "::1", "proto": "HTTP/1.1", "method": "GET", "host": "localhost:8080", "uri": "/xxx/yyyyy/GETPHRASES/Page", "headers": {"Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Dest": ["empty"], "Referer": ["http://localhost:8080/xxx/yyyyy/runclient/Page"], "Accept-Language": ["es-AR,es-US;q=0.9,es-419;q=0.8,es;q=0.7"], "X-Vtscadaphraseids": ["REASON_STR_HOSTNOTINLIST"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Mode": ["cors"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"], "Accept-Encoding": ["gzip, deflate, br, zstd"], "Connection": ["keep-alive"], "Sec-Ch-Ua": ["\"Chromium\";v=\"124\", \"Google Chrome\";v=\"124\", \"Not-A.Brand\";v=\"99\""], "X-Vtscadaanywhere": ["true"], "Sec-Ch-Ua-Mobile": ["?0"], "Accept": ["*/*"]}}, "bytes_read": 0, "user_id": "", "duration": 0.0647577, "size": 66, "status": 200, "resp_headers": {"Server": ["Caddy", "VTScada"], "Cache-Control": ["no-cache, no-store"], "Date": ["Thu, 2 May 2024 11:25:20 GMT"], "Content-Type": ["application/json; charset=\"utf-8\""], "Content-Length": ["66"]}}
3. Caddy version:
caddy_2.8.0-beta.1_windows_amd64
4. How I installed and ran Caddy:
I created a caddyfile in same folder as caddy.exe
inside a bat file
caddy run
a. System environment:
Windows 10 Pro 22H2
b. Command:
caddy run
c. Service/unit/compose file:
d. My complete Caddy config:
:8080 {
log
reverse_proxy /xxx* https://www.example.com {
header_up host {upstream_hostport}
}
rewrite / /xxx/
}