How to add host in custom header at GLB

Hi ,

I have a requirement to  add the actual host in custom header at GLB so that i can fetch the host in apigeex from that header.

Example -

URL - https://test1.com/v1/abc

When request reaches at GLB , I want to fetch test1.com from the url and add it in the custom header say -

custom-header:test1.com

so that ,i can fetch the value as test1.com from custom header in apigeex.

Can anyone help me the way out to achive the above use case.

1 1 325
1 REPLY 1

This is more of a Cloud Load Balancing question so please consider posting it on the linked forum for better support going forward. But the documentation on how to create custom headers at the GCLB is available here for the classic version and here for the newer version. 

You can use the {tls_sni_hostname} variable to get the SNI hostname and set a custom header accordingly. Also, I'm not sure what you're trying to do and your use case, but you should consider using the Host header in Apigee or Apigee's TLS variables since most of the time the DNS in the GCLB will match an existing env group in Apigee.