I have a API hosted on Google Cloud Run and exposed using API Gateway and GCP's Load Balancer in front of the gateway. This API is supposed to be used by multiple tenants, so the requests will come from different origins.
Right now, whenever I try to access the API from another tenant domain, I'm getting a 404 because of a CORS issue.
When I first setted it up, I was getting an error that the Access-Control-Allow-Origin
was not present in the response. Then, I updated the Load Balancer config to add Access-Control-Allow-Origin: '*'
to the response's header.
Now, after setting the header, I'm still getting 404 but the error message changed to Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
Is there a way I can set the Load Balancer to not block request due to a CORS issue?
question from:
https://stackoverflow.com/questions/65907498/gcp-load-balancer-api-gateway-cors-issue 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…