_remote_ip problems
-
I moved a website to a new hosting service and _remote_ip started not working properly. It started reporting 127.0.0.1 as the IP for all form submissions.
The hosting company asked me to add the following to my wp-config.php file and it fixes the problem only if I disable Varnish cache.
if ( isset( $_SERVER[ "HTTP_X_FORWARDED_FOR" ] ) ) { $_SERVER[ 'REMOTE_ADDR' ] = $_SERVER[ "HTTP_X_FORWARDED_FOR" ]; }Once I enable Varnish with the above code in wp-config.php, I get nothing for _remote_ip (without above code, I get 127.0.0.1).
Disabling Varnish is not a good option so I’m looking for another solution.
Additional info that might be relevant:
- Host is Cloudways with DigitalOcean server
- Using Mailgun for SMTP
- Using WP Mail SMTP plugin
- Using Breeze cache plugin
- Using Cloudflare
Any ideas for getting _remote_ip to report the proper IP address?
Eric
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘_remote_ip problems’ is closed to new replies.