I have a global external http load balancer (CLASSIC) and want to use the X-Forwarded-For request header to route traffic between 2 backend services, all this in the url map. I haven’t accomplish this until now. It seems to me that the LB is not allowing it.
This setting can’t be achieved as HTTP(S) Load Balancer does not directly support routing based on the X-Forwarded-For header. The load balancer primarily uses layer 7 (application layer) information like URL paths, hostnames, or other layer 7 data for routing.
If you need to route traffic based on the client’s IP address (which would typically be in the X-Forwarded-For header), you might need to consider other solutions or workarounds. For example:
Google Cloud Armor can be set up to permit or restrict traffic according to specified IP addresses or ranges. Although it doesn’t precisely route traffic based on X-Forwarded-For, it provides a means to manage access by focusing on IP addresses.
You could implement a proxy or firewall positioned ahead of your backend services, handling routing decisions based on the X-Forwarded-For header.
Thank you Marvin, I achieved this by creating a virtual path for my application, then, I check the client IP address and send desired clients to that path. Finally in the LB use URL path for routing.