This is my environment setup:
- Server A hosts the site (Nginx + PHP-FPM + Wordpress)
- Server B is Nginx reverse proxy for server A
- Cloudflare reverse proxy is on top of all.
Therefore, user request first go to Cloudflare, then server B and then server A. I've set:
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
on server B. I've also installed Cloudflare wordpress plugin, but Wordpress still gets server B IP address instead of user IP address, detecting Cloudflare IP addresses as originating IPs. :(
Installing Proxy Real IP changes Server B IP addresses to Cloudflare IP addresses, not real user IP.
Any help to get real user IP address at Wordpress end?