CDN Proxy and Visitor IP
Behind a CDN or proxy (Cloudflare, Bunny, CloudFront, Sucuri, Fastly and others), your server sees the CDN’s address instead of the visitor’s. Without the real address, a location lookup would find the CDN’s country, not the visitor’s.
Visitor IP address setting#
Go to WooCommerce > Smart Phone Field > Location > Visitor IP address.
- Automatic (default): reads the visitor’s real IP from the CDN’s or proxy’s header, then falls back to the server connection.
- Server connection only: ignores those headers. Use this if your site isn’t behind a CDN or proxy, so visitors can’t send a made-up header.

Skip the lookup completely#
If your CDN or host adds a country header, choose CDN or hosting headers as the Detection method. The country is read straight from the header, with no outside call. Headers from Cloudflare, Bunny, CloudFront, Vercel, CDN77, Sucuri and server GeoIP are supported. On Cloudflare, make sure IP Geolocation is on.
Every visitor gets the same country?#
You’re probably behind a proxy. Set Visitor IP address to Automatic, or switch to CDN or hosting headers. If that doesn’t help, ask your host to pass the real visitor IP through.
In code#
nahnu_spf_client_ip_headerslists the request headers that carry the real visitor IP, most specific first.nahnu_spf_cdn_country_headersandnahnu_spf_cdn_state_headerslist the headers read for the country and state.