I have a website that is using cf-ipcountry
header to detect client ip country.
I would need to proxy pass to this website from another server.
Here is my sample nginx config for proxy pass:
server {
listen 80;
server_name ...;
location /test {
proxy_pass http://{domain-handled-by-cloud-flare-with-geolocation};
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Proxy pass is working but in this case cf-ipcountry
header is always set to country from proxy server location, not from client location that is making request.
Domain for proxy server is not on Cloudflare so i can’t pass cf-ipcountry
header myself.
Is it possible to pass somehow client ip from proxy server to Cloudflare so geolocation would give me ip country form client location?