如何使用未经验证的自定义域名与Google App Engine [英] How to use unverified custom domains with Google App Engine

查看:133
本文介绍了如何使用未经验证的自定义域名与Google App Engine的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要客户将自己的自定义域名指向我的GAE应用程序。

I need customers to be able to point their own custom domains to my GAE app.

customersdomain.com - CNAME - > myapp.com(其又指向myapp.appspot.com)

e.g. customersdomain.com -- CNAME --> myapp.com (which in turn points to myapp.appspot.com)

我知道我可以将域链接到我的Google帐户,然后使用该域来提供应用引擎,但此过程不会扩展,并要求我直接访问客户的域注册/ DNS。唯一的其他选择是强制客户注册Google Apps(为什么!)。

I know that I can link a domain to my Google account and then use that domain to serve app engine, but this process does not scale and requires that I have direct access to the customer's domain register/DNS. The only other alternative is to force customers to sign up for Google Apps (why!).

几乎所有其他PaaS都使这个过程无痛苦:

Almost all other PaaS make this process painless:


  • 在Heroku中,我只需将该域添加到白名单,客户
    将添加一个CNAME记录。

  • 在AWS中,指向实例的单个CNAME记录将成为伎俩。

谁知道这个的解决方法?或者我只需要手动将数百个域名链接到我的帐户?

Does anyone know of a workaround for this? Or am I just going to have to manually link hundreds of domains to my account?

推荐答案

你正在要求不可能的事情。 App Engine不使用固定IP,因此无法根据IP决定应该提供哪些应用程序。选择是由包含URL的请求进行的,如下所示:

You are asking for something impossible. App Engine does not use fixed IPs, so it cannot decide what application it should serve based on IP. The choice is made by the request that contains the URL, like so:

GET http://custom.example.com/resource.html

服务器提取域名custom.example.com并决定此域您的请求是指哪个应用程序。为了做到这一点,它必须有一个映射表,哪些域映射到什么应用程序。您必须通过在开发者控制台中输入域才能填写此映射表。

A server extracts the domain part "custom.example.com" and decides upon this domain which application is meant by your request. In order to do so it must have a mapping table with what domain maps to what application. It is this mapping table that you must fill by entering your domains in the developers console.

当您的域上有cname记录时,浏览器首先会根据您的请求解析IP 。所有应用程序引擎应用程序之间共享相同的IP地址,因此单独的IP地址无法确定您的应用程序。所以不,你不能只是添加CNAME,并希望appengine只是知道该怎么做,你必须明确告诉appengine。

When you have cname records on your domain the browser first resolves an IP for your request. The same IP addresses are shared between all app engine applications, so the IP address alone is useless to determine your application. So no, you cannot just add CNAMEs and expect appengine to just know what to do, you'll have to tell appengine that explicitly.

说明。您可以使用通配符进行自定义域。也许这可以帮助。否则,我认为客户创建自己的转发的唯一选择是使用帧。许多域名提供商提供的服务将承载一个非常简单的html页面,将以完整的宽度/高度框架显示目标网站。我总是觉得框架解决方案是某种欺骗行为,但在您的情况下可能是最佳选择。

Speaking of explicit. You can use wildcards for custom domains. Maybe that can help. Otherwise the only option i see for customers to create their own forwards is to use frames. Many domain providers offer a service that will host a very simple html page that will show the target website in a full width/height frame. I always feel like the frame solution is some sort of cheat but it might be the best choice in your case.

这篇关于如何使用未经验证的自定义域名与Google App Engine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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