1. Caddy version (caddy version
):
v2.5.1 h1:bAWwslD1jNeCzDa+jDCNwb8M3UJ2tPa8UZFFzPVmGKs=
2. How I run Caddy:
a. System environment:
Ubuntu 20
Not using docker
Not using kubernetes
b. Command:
sudo systemctl start caddy
c. Service/unit/compose file:
?
d. My complete Caddyfile or JSON config:
(auth) {
forward_auth :9000 {
uri {path}?remote_ip={remote_addr}
header_up X-Forwarded-Ip {remote_addr}
copy_headers Remote-Ip Remote-Addr Remote-User Remote-Groups Remote-Name Remote-Email X-Real-IP
}
}
3. The problem I’m having:
I want to access the inbound client ip address in the auth server that is responding to forward_auth but all I see in the headers of the inbound auth request is 127.0.0.1 and when I try to write in the ip address in a rewrite it say ‘nil’
{'host': 'editorapi.videopcom', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36', 'accept': '*/*', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8', 'content-type': 'application/json', 'origin': 'https://editorfrontend.videop.com', 'referer': 'https://editorfrontend.videop.com/', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-site', 'x-forwarded-foo': '', 'x-forwarded-for': '127.0.0.1', 'x-forwarded-host': 'editorapi.videop.com', 'x-forwarded-method': 'GET', 'x-forwarded-proto': 'http', 'x-forwarded-uri': '/paintbox/my-team/test'}
4. Error messages and/or full log output:
n/a
5. What I already tried:
I’d tried many variations of headers and header names and copying headers and including on the path but nothing.
remote_ip
remote_addr