0

I'm Using google cloud to serve my application.

When i add a load balancer in front of my app, the load balancer ip is appended to the "x-forwarded-for" header (alongside the user's host ip) in the each session request to the server.

My question is how can i configure the load balancer not to append his ip on each user request?

Attaching the load balancer settings in google cloud, i can't see any advanced configurations here:

enter image description here

Rot-man
  • 18,045
  • 12
  • 118
  • 124
  • Found also this useful discussion - (check the comments for the accepted answer): https://stackoverflow.com/questions/35246089/getting-orgin-ip-from-load-balancer – Rot-man May 08 '18 at 11:44

1 Answers1

4

X-Forwarded-For is a standard HTTP request header and, as such, the LB is doing the right thing by maintaining it in the request that lands on the backend. You can read more about its use in Google Cloud here.

As far as I know, there's no way to strip away request headers at the LB level in Google Cloud. You can, however, create custom headers. Look here for more information on that.

Lopson
  • 1,202
  • 1
  • 8
  • 20