AppEngine实例的许多自定义域 [英] Many Custom Domains for AppEngine Instance

查看:95
本文介绍了AppEngine实例的许多自定义域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我们在AppEngine上运行的电子商务服务,我们希望为客户提供在其自定义域名上运行商店的选项(例如:www.mystore.com,而不是www.enstore.com/mystore)。 p>

从用户角度来看,我希望他们在他们的首选项屏幕中输入他们想要使用的域名,并告诉他们如何配置他们的dns。

b
$ b

我知道您通常如何将域添加到AppEngine实例(通过Google Apps),但我不确定您是否可以自动执行此操作。即使这是可能的,他们将全部(数百)在我们的谷歌应用程序页面上列出。



任何人都知道这是否可行/是否有很好的方法来做到这一点?

解决方案

我认为没有办法以编程方式将域添加到AppEngine实例。显然,只能使用您描述的Google Apps方法添加域。这在这个SO帖子中得到了证实:如何让foo.somedomain.com通过myapp.appspot.com/foo在appengine上处理



唯一需要考虑的选项如下:


For our e-commerce service running on AppEngine we would like to offer the option for customers to run the stores on their custom domains (eg: www.mystore.com instead of www.enstore.com/mystore).

From a user perspective, I'd like them to enter the domain name they want to use in their preference screen and tell them how to configure their dns.

I know how you normally add domains to an AppEngine instance (through Google Apps) but I'm not sure you can automate that. And even if that's possible they would be all (hundreds) listed on our google apps page.

Anyone know if this is possible/if there is a good way to do it?

解决方案

I don't think there is a way to add domains "programatically" to an AppEngine instance. Apparently, domains can only be added by using the Google Apps method that you described. This is confirmed in this SO post: How do i get foo.somedomain.com get handled by myapp.appspot.com/foo on appengine

The only options that pop to mind are the following:

  • HTTP Redirection

    Many DNS providers support HTTP Redirection. In this case, your clients would be able to set up mystore.com and www.mystore.com to redirect to www.enstore.com/mystore. There are some obvious disadvantages with this method that might not be acceptable. First of all, with 301 and 302 redirects, the users will still be forwarded to the registered AppEngine URL: www.enstore.com/mystore, and it will show in their browser. In addition, choosing between a 301 and 302 redirect can make SEO tricky, since you'd have to get into how search engines behave with these redirects. For example most search engines will not use the original URL as a source for keywords when you use a 301 redirect.

    In addition to 301 and 302 redirects, some DNS providers (like DNS Made Easy) also provide what they call a "masked hidden-iframe redirect". The page will render inside a hidden iframe, so the URL does not change in the user's browsers. However this makes SEO even more tricky, and it will not allow users to bookmark internal pages, or to reference them easily.

    As you can see, this option is less than ideal, but it is one option to consider in some situations. Also note that at the moment, HTTP Redirection using 301 redirects is the suggested workaround for the Naked Domain Issue 777 on the AppEngine issue tracker.

  • Reverse Proxy

    Another option could be to set up a small server somewhere else, like a small Amazon EC2 Instance, and set up a simple reverse proxy. You would be able to set this up very easily, just by using Apache and mod_proxy (or various other alternatives). This would allow you to ask your clients to set up a normal A Record pointing to this instance, while the Apache HTTP server would be acting as a proxy to your AppEngine.

    The fundamental configuration directive to set up a reverse proxy in mod_proxy is the ProxyPass. You would typically set it up with one line like these for each VirtualHost (for each client domain):

    ProxyPass / http://www.enmystore.com/mystore/

    The configuration of the remote proxy could be easily handled by your back-end software.

    This is a neater solution which gives you plenty of control - but there are obviously some costs for these benefits. First of all, there is the expense to host the reverse proxy. You would also be adding another point of failure, so you have to add this to your high-availability plan. In addition, if you are serving some pages through SSL it can become quite complicated.

这篇关于AppEngine实例的许多自定义域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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