X-Forwarded-For HTTP header code
-
Hi,
When Wordfence gets the IPs using the ‘Use the X-Forwarded-For HTTP header. Only use if you have a front-end proxy or spoofing may result.’ method (for sites integrated with Ezoic), is adding the following code to wp-config.php also necessary/recommended?
/** Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address*/ if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { $http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] ); $_SERVER['REMOTE_ADDR'] = $http_x_headers[0]; }
Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘X-Forwarded-For HTTP header code’ is closed to new replies.