是否可以在带有一个域名的Google App Engine的Google云端存储上投放静态文件? [英] Is it possible to serve static files on Google Cloud Storage with Google App Engine with one domain?

查看:77
本文介绍了是否可以在带有一个域名的Google App Engine的Google云端存储上投放静态文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

第二,上传一张静态图片 example.jpg 到Google Cloud Storage https://cloud.google.com/products/云存储又名 https://developers.google.com/storage/



是否可以将 example.jpg 作为 http://www.example。 COM /图像/ example.jpg ?而不是像 images.example.com cdn.example.com 等等

这样的子域名。 b
$ b

我想这样做的原因是因为我希望在必要时将我的网站移动到VPS。

解决方案

我不相信,不。一个域名必须路由到Google云端存储或Google App Engine。



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



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


First, Build a site www.example.com with Google App Engine https://cloud.google.com/products/

Second, Upload a static image example.jpg to Google Cloud Storage https://cloud.google.com/products/cloud-storage aka https://developers.google.com/storage/

Is it possibe to serve the example.jpg as http://www.example.com/images/example.jpg? instead of using a subdomain such as images.example.com or cdn.example.com etc

The reason I want to do this is because I want to make it easier to move my site to a VPS when necessary.

解决方案

I don't believe so, no. A single domain name must route to either Google Cloud Storage or Google App Engine.

You could cheat, mind you. You could configure your app engine app to take all requests for, say "/images/X" and redirect them to images.example.com/X, or you could have your app read the data from GCS and feed it back to the user directly from app engine, but neither of those are a good solution.

If you wanted to move to a VPS later, you could perhaps configure the VPS to handle two domains, one for images and one for dynamic content.

这篇关于是否可以在带有一个域名的Google App Engine的Google云端存储上投放静态文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆