自定义域映射到Google App Engine模块或版本 [英] Custom domain mapping to Google App Engine module or version

查看:207
本文介绍了自定义域映射到Google App Engine模块或版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个Google App Engine应用程序,其中有几个模块有几个版本。可以将自定义域名映射到应用程序的特定模块的特定版本吗?



例如:



http://www.example.com 应映射到 http://module1-dot-app1.appspot.com

解决方案

1.将模块映射到自定义域



假设您是域 example.com 的管理员,并且要映射子域 www.example.com 到应用程序中的 webmodule模块 myapp.appspot.com



www.example.com - > webmodule.myapp.appspot.com



您可以做的是转到admin.google.com和App Engine Apps部分配置您的应用程序,以便映射到网址 www.example.com 。当然,请遵循配置您的域的说明(您应该使用ALIAS www和HOST ghs.googlehosted.com在您的DNS配置中添加一个CNAME条目)。



一旦这样做,网址 www.example.com 链接到您的应用程序默认模块。要重定向到 webmodule ,您需要使用 dispatch 文件配置应用程序内部路由,如下所述:



https://developers.google.com/appengine/docs/python/modules/routing



在你的情况下,你需要的是这样的东西(这是从Python应用程序的dispatch.yaml文件):

  dispatch:

- url:www.example.com/*
module:webmodule

2.将版本映射到自定义域



关于版本,您似乎无法将URL映射到特定的模块版本。你可以做的是将包含版本的URL映射到特定的模块,但这可能有点混乱。


Suppose I have a Google App Engine application which has several modules which have several versions. Can I map a custom domain name to a specific version of a specific module of the application?

For example:

http://www.example.com should be mapped to http://module1-dot-app1.appspot.com

解决方案

1.Mapping a module to custom domain

Let's suppose you are admin for domain example.com and you want to map subdomain www.example.com to module webmodule in your application myapp.appspot.com

www.example.com -> webmodule.myapp.appspot.com

What you can do is going to admin.google.com and in App Engine Apps section configure your application so that it is mapped on web address www.example.com. Of course follow the instruction for configuring your domain (you should add a CNAME entry in your DNS configuration with ALIAS www and HOST ghs.googlehosted.com).

Once you did this, web address www.example.com is linked to your application default module. For redirecting to webmodule you need to configure application internal routing with dispatch file, as reported here:

https://developers.google.com/appengine/docs/python/modules/routing

In your case what you need is something like this (this is from dispatch.yaml file for Python application):

dispatch:

    - url: "www.example.com/*"
      module: webmodule

2.Mapping a version to custom domain

Regarding versions, it seems you cannot map an url to a specific module version. What you can probably do is mapping an url including version to a specific module, but this is maybe little bit confusing.

这篇关于自定义域映射到Google App Engine模块或版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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