-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caddy log format - client_ip should be used instead of remote_ip #2601
Comments
Hey, thanks for letting me know! Do you mind sharing a few lines from your access log so I can check out the latest changes? |
Direct access without loadbalancer / proxy:
client_ip = remote_ip = my public IP Using loadbalancer / proxy:
remote_ip=172.71.190.23 is cloudflare IP here, while client_ip=X.X.X.X is my own public IP. |
I've edited my goaccess.conf file, usually found in time-format %s
date-format %s
...
# CADDY JSON Structured
-#log-format {"ts":"%x.%^","request":{"remote_ip":"%h","proto":"%H","method":"%m","host":"%v","uri":"%U","headers":{"User-Agent":["%u","%^"]},"tls":{"cipher_suite":"%k","proto": "%K"}},"duration": "%T","size": "%b","status": "%s","resp_headers":{"Content-Type":["%M;%^"]}}
+log-format {"ts":"%x.%^","request":{"client_ip":"%h","proto":"%H","method":"%m","host":"%v","uri":"%U","headers":{"User-Agent":["%u"],"Referer":["%R"]},"tls":{"cipher_suite":"%k","proto": "%K"}},"duration": "%T","size": "%b","status": "%s","resp_headers":{"Content-Type":["%M"]}} Take note that more had to be changed than just Then I can happily view my logs with visitor IPs logged from my trusted proxy's headers.
The default config file's comment for Caddy JSON should probably be updated to handle headers the same way as the preset -- and then it would be trivial for someone to uncomment it and swap |
Fixed on #2629 |
Currently goaccess uses remote_ip in Caddy json format, but according to docs client_ip should be used since it's the one being set with proper ips when using proxies.
https://caddyserver.com/docs/caddyfile/matchers#client-ip
The text was updated successfully, but these errors were encountered: