'Point custom Domain to the google cloud function through global https loadbalancer with serverless NEG as backend
I had a running myfunctionname
cloud function with HTTP trigger URL:
For Ex- https://us-central1-my-project.cloudfunctions.net/myfunctionname
Now I want to map this cloud function URL to public domain URL
For Ex- https://my-domain.com/path
Public domain URL is setup in DNS to point to loadbalancer. Global external https loadbalancer is created with host, path rules & backend service
Host:
my-domain.com
, Path Rule:/path
, Backend Service:Serverless NEG pointing to myfunctionname cloud function
Now if I hit the API endpoint with the Cloud Function Http trigger URL, API response is 200 OK, it's working
GET
Request on endpointhttps://us-central1-my-project.cloudfunctions.net/myfunctionname/show/jobs
But when I hit the API endpoint with the custom domain URL:
GET
Request on endpointhttps://my-domain.com/path/show/jobs
API error response is 404 Not Found. Cannot GET /myfunctionnameshow/jobs
Can someone please point out the issue why my custom domain URL is not redirected to cloud function URL? Actually my expectation is hitting https://my-domain.com/path/show/jobs
API endpoint should be equivalent to hitting https://us-central1-my-project.cloudfunctions.net/myfunctionname/show/jobs
API endpoint.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|