I have an Express app used by several companies. Each company has its own subdomain to call the app api, such as company1.mydomain.com
, company2.mydomain.com
. In Express we read the value of the subdomain to determine the custom operation that we have to do for that company.
We are moving this app to GCP using Cloud Run with a GCP Load Balancer, setting all subdomains on the latter. We are now trying to read the subdomain but it contains the subdomain value of the Cloud Run URL (xxxxx.a.run.app
). We are trying to figure out how to get the subdomain the user is requesting (the one configured in the Load Balancer) but that value doesn't seem to be forwarded to Cloud RUN.
Are there any settings that we are missing or something that help us to read the subdomain value from Cloud Run?
PD: We tried using Load Balancer's Custom Header but there is no option related to subdomain value
PD2: We also tried checking the other headers (including the X-Somethingxx
GCP headers) and found nothing
question from:
https://stackoverflow.com/questions/66066897/forward-requested-subdomain-host-from-gcp-load-balancer-to-cloud-run 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…