使用云功能创建外部负载平衡器到云CDN

发布于 2025-02-01 09:49:11 字数 981 浏览 3 评论 0原文

我尝试使用CDN配置Google Cloud功能。 我尝试使用本教程: https://cloud.google。 com/cdn/doc/设置cdn-with-serverless

一个功能作为后端端点看起来都不错,如果我打开负载平衡前端IP,我会看到与打开直接功能URL相同的结果。并且似乎这意味着如果我使用此IP,现在可以通过CDN使用此功能。

但是我的功能太多了,因此我尝试使用端点中的所有功能使用URL蒙版。 URL掩码看起来像这样:

https://us-central1-my-real-project.cloudfunctions.net/<function>

我无法理解如何使用使用URL蒙版创建的云功能将负载平衡前端IP用于我的端点。 当我打开负载平衡IP时,我会得到:

Error: Not Found
The requested URL / was not found on this server.

PS。同样,如果我尝试打开http:// load-balancing-frontend-ip&gt;/my-function-name

upd:

在Google驱动器中放置的配置:配置:

< a href =“ https://drive.google.com/drive/folders/1ei9tx_sqcj_ujrlt-xzezua9bwklszik?usp = sharing” UA9BWKLSZIK ?usp =共享

对不起,不知道如何共享其他方式配置,并且由于声誉较低而无法直接附加相关图像

I try configure my Google Cloud Functions by using CDN.
I try use this tutorial: https://cloud.google.com/cdn/docs/setting-up-cdn-with-serverless

With one function as Backend Endpoint looks all good, and if I open Load Balancing Frontend IP I see same result as I open direct function URL. And seems that this means this function now work over CDN if I use this IP.

But I have too many functions, because of this I try use URL mask for all functions in my Endpoint.
URL mask looks like this:

https://us-central1-my-real-project.cloudfunctions.net/<function>

Problem that I cant understand how I can use Load Balancing Frontend IP for my Endpoint with Cloud Functions created with URL mask.
When I open Load Balancing IP I get:

Error: Not Found
The requested URL / was not found on this server.

PS. Same if I try open http://<load-balancing-frontend-ip>/my-function-name

UPD:

Configurations in screenshots placed in google drive:

https://drive.google.com/drive/folders/1eI9tx_SQcJ_uJrlt-xzeZua9bwklszik?usp=sharing

(sorry, not know how share other way configuration, and cant attach images direct in question because of low reputation)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不必你懂 2025-02-08 09:49:11

As described in the documentation, the URL mask must be only /<function>. No URL before.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文