是否可以通过一个域名使用Google App Engine在Google云端存储上提供静态文件?

Gab*_*lis 6 google-app-engine google-cloud-storage

首先,www.example.com使用Google App Engine 构建网站https://cloud.google.com/products/

其次,将静态图像上传example.jpg到Google云端存储https://cloud.google.com/products/cloud-storage aka https://developers.google.com/storage/

难道possibe以服务example.jpghttp://www.example.com/images/example.jpg?而不是使用诸如images.example.comcdn.example.com等的子域

我想这样做的原因是因为我希望在必要时让我的网站更容易移动到VPS.

Bra*_*ugh 2

我不相信,不。单个域名必须路由到 Google Cloud Storage 或 Google App Engine。

请注意,你可能会作弊。您可以将应用程序引擎应用程序配置为接受所有请求,例如“/images/X”并将它们重定向到 images.example.com/X,或者您可以让您的应用程序从 GCS 读取数据并将其反馈给用户直接从应用程序引擎,但这都不是一个好的解决方案。

如果您想稍后迁移到 VPS,您也许可以将 VPS 配置为处理两个域,一个用于图像,一个用于动态内容。