Closed radokristof closed 1 year ago
In nginx logs I can see the correct IP in log lines, like this:
2023-07-18T08:50:42+02:00 <ACTUAL-IP-REDACTED>, 172.68.51.80 (Cloudflare proxy IP)
Same for php-fpm log, just appended a localhost proxy to the list:
2023-07-18T08:50:42+0200 <ACTUAL-IP-REDACTED>, 172.68.51.80 127.0.0.1
However on Admin Panel -> Dashboard -> System logs, the IP is incorrect. What can be changed to have this work correctly?
It was an osticket config error. Need to specify 'TRUSTED_PROXIES' also in 'ost-config.php' file and add cloudflare networks there
I'm using caddy as a reverse proxy, also CloudFlare DDos protection is used (so generally another proxy).
In docker-compose right now for testing purposes I have this:
Caddy config is simple:
Thought even this way, I can only see Cloudflare IPs in the logs. Docker gets IP from 192.168.0.0/16 range, so this is also unique. If I remove the NGINX_SET_REAL_IP env, I can only see the docker IP address, with this setting Cloudflare proxy IP, but I never seen the real IP in the logs.
What am I missing, what should be configured?