通过全局https loadbalancer用无用的neg作为后端,将自定义域的定制域与Google Cloud函数指向Google Cloud函数
我有一个运行myFunctionName
带有http触发URL的云函数:
对于Ex- https://us-central1-my-project.cloudfunctions.net/myfunctionname
,
我现在想将此云功能URL映射到
ex- https://my-domain.com/path
公共域URL的公共域URL中,以DNS设置为LoadBalancer。全局外部HTTPS LoadBalancer是由主机,路径规则&创建的后端服务
主机:
my-domain.com
,路径规则:/path
,后端服务:无用的neg指向myFunctionName cloud cloud函数
P>
如果我点击了带有云函数http触发URL的API端点,API响应为200,它正在工作
get
endpoint上的请求https://us-central1-my-project.cloudfunctions.net/myfunctionname/show/jobs
但是当我使用自定义域名登录API端点时URL:
get
endpoint上的请求https://my-domain.com/path/show/jobs
API错误响应是404。无法获得/myfunctionNameshow/jobs
有人可以指出问题,为什么我的自定义域URL未重定向到云功能URL?实际上,我的期望是击中https://my-domain.com/path/show/jobs
api端点应该等于https://us-central1-my-project.cloudfunctions https://us-central1-my-functions。 .net/myFunctionName/show/jobs
api端点。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论