What is the name of the domain?
What is the issue you’re encountering
WAF and Analytics show all traffic is coming from reverse proxy IP
What steps have you taken to resolve the issue?
I have Caddy running as a reverse proxy on a VM so users can set custom domains. This then routes through Cloudflare to the app server and while this all works fine, I can’t use Cloudflare Analytics and WAF rules/rate limiting because all of the traffic (according to Cloudflare) is coming from the same IP address (the reverse proxy).
Is there any way to get Cloudflare to use the X-Forwarded-For header to preserve the original client IP? Here’s my Caddy setup:
reverse_proxy https://example.com {
header_up Host {upstream_hostport}
header_up True-Client-IP {remote_host}
header_up X-Forwarded-For {remote_host}
header_up X-Real-IP {remote_host}
header_up X-Forwarded-Proto {scheme}
}