在Google Appengine中禁用特定于版本的网址 [英] Disabling version specific urls in Google appengine
问题描述
Google App-Engine支持特定版本的请求路由,如
Google App-Engine supports version-specific routing of requests as documented here. This is useful for example for testing a new version prior to deploying it. However, this may also be problematic. Say the new version includes security enhancements - there should be a way to prevent access to previous versions without deleting them completely (in order to allow for quick roll-back for instance). Could not find a way to disable previous versions. Is there a way to accomplish that ? Thanks.
推荐答案
无法在appspot.com
域上禁用默认/软/目标路由.
There is no way to disable default/soft/targeted routing on the appspot.com
domain.
但是您可以分析请求的url结构,并特别拒绝带有此类不希望有的url的请求.
But you could analyze the request's url structure and specifically reject requests with such undesired urls.
或者,如果您使用的是自定义域,请拒绝所有appspot.com
请求(请参阅
Or, if you're using a custom domain, reject all appspot.com
requests (see Disable default domain https://[project-id].appspot.com of Node JS on Google App Engine) and only leave the custom domain operational. Then the domain will be served following the service's traffic migration/splitting configuration which you'd manipulate in your deployments/rollback actions (you cannot route to a specific service version in the dispatch.yaml
file)
更新:确实,正如评论所提到的,盲目拒绝所有appspot.com
请求不是一个好主意.由于需要解析URL以选择不需要的URL,因此有必要抓住机会重定向到规范化的自定义域对应对象,而不仅仅是拒绝请求.
Update: indeed, as comments mentioned, blindly rejecting all appspot.com
requests isn't a good idea. Since URLs would need to be parsed to select the undesired ones it may be worthy to take the opportunity to redirect to canonical custom domain counterparts instead of just rejecting the requests.
这篇关于在Google Appengine中禁用特定于版本的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!