Title: Fix HTTP_X_FORWARDED_FOR issue
Last modified: January 20, 2022

---

# Fix HTTP_X_FORWARDED_FOR issue

 *  Resolved [samsteve169](https://wordpress.org/support/users/samsteve169/)
 * (@samsteve169)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fix-http_x_forwarded_for-issue/)
 * Hello,
 * I’m the CTO of a big italian web hosting company and I’m writing about an issue
   that impact a lot of our customer (over 10000 sites).
 * The issue consist in the error “Unable to load cookie scanner. Scanning will 
   not work on local server.”.
 * Your plugin check if the header “x-forwarded-for” is set. If “yes” the plugin
   totally ignore the value of other variables, for example “REMOTE_ADDR”.
 * In our scenario, the HTTP_X_FORWARDED_FOR variable is set with value 127.0.0.1(
   for an internal reverse proxy done with varnish) and REMOTE_ADDR is correctly
   fitted with the user IP.
 * You need to check the content of ALL variables and if ALL variables contain “
   127.0.0.1”, show the error message “Unable to load cookie scanner. Scanning will
   not work on local server.”.
 * If you need more details, just text me!

Viewing 1 replies (of 1 total)

 *  Plugin Author [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * (@webtoffee)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fix-http_x_forwarded_for-issue/#post-15282701)
 * Hi [@samsteve169](https://wordpress.org/support/users/samsteve169/),
 * Greetings from Webtoffee!
 * Sorry for the inconvenience caused to you. This issue happens because the scanner
   checks whether the site is hosted from a local server using the key in “HTTP_X_FORWARDED_FOR”.
   If the IP is returned as “127.0.0.1” the plugin will show the message “Unable
   to load cookie scanner. Scanning will not work on local server.”.
 * To avoid this from happening you can copy the code [from here](https://gist.github.com/webtoffee-git/21188723d2f63b5bbd065c3b02a767de)
   to your sites child themes functions.php and modify the ‘key’ value of the variable
   $_SERVER from the return line of the function as “REMOTE_ADDR”.

Viewing 1 replies (of 1 total)

The topic ‘Fix HTTP_X_FORWARDED_FOR issue’ is closed to new replies.

 * ![](https://ps.w.org/cookie-law-info/assets/icon.svg?rev=3007243)
 * [CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)](https://wordpress.org/plugins/cookie-law-info/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-law-info/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-law-info/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-law-info/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-law-info/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-law-info/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/fix-http_x_forwarded_for-issue/#post-15282701)
 * Status: resolved