Loadbalancer sets wrong client_region and client_region_subdivision

I’m using Google Cloud Loadbalancer in front of some Cloud Run Instances for Server-GTM.

In front of the Loadbalancer we want to route the traffic trough our main domain with an nginx reverse proxy.

So we set up everything like this in nginx:

  • proxy_set_header X-Real-IP $remote_addr;
  • proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  • proxy_set_header X-Forwarded-Proto $scheme;

In the Google Cloud Loadbalancer we are setting some Headers:

  • X-Gclb-Country: {client_region}
  • X-Gclb-Region: {client_region_subdivision}

This headers are based on the nginx server’s IP and not on the real client’s IP.

Are we doing something wrong here?