正确地将仅HTTPS自定义域分配给flex env [英] Correctly assign HTTPS only custom domain to flex env

查看:63
本文介绍了正确地将仅HTTPS自定义域分配给flex env的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将自定义域映射到Google App Engine项目的正确方法是什么?

What is the correct way to map a custom domain to Google App Engine project?

我已经添加了自定义域,设置了所有DNS记录等,并且可以正常工作!但是,我如何仅执行HTTPS? (就像生成的自定义域一样)

I've added the custom domain, set up all the DNS records etc. and it is working! But how do I enforce HTTPS only? (Like the custom domain generated does)

通过阅读许多帖子,我在handler中看到了secure: always,但我尝试了一下,但似乎没有用(看到一些评论说它在flex上不起作用环境?)

From reading around many posts I have seen secure: always in a handler which I have tried, but doesn't seem to work (saw some comments that it doesn't work on flex environments?)

那么,如何将我的域正确映射到仅HTTPS的flex php环境?想要做的事情似乎很简单!

So how can I correctly map my domain to a flex php environment being HTTPS only?! Seems such a simple thing to want to be able to do!

推荐答案

仅与自定义域相关(例如,HTTPS使用的SSL证书绑定到该域),仅HTTPS行为实际上不是属性自定义域映射操作的过程,它只是应用程序本身的一种行为(无论是否映射到自定义域).

While being somewhat related to a custom domain (for example the SSL certificate used by HTTPS being tied to the domain) the HTTPS-only behaviour is not really an attribute of the custom domain mapping operation, it's just a behaviour of the app itself (regardless of being mapped to a custom domain or not).

对于标准环境GAE应用程序,仅HTTPS行为的一部分是自动http-> https重定向,如果在app.yaml配置文件中设置了secure: always,则GAE红外技术将代表该应用程序执行重定向

For standard environment GAE apps part of the HTTPS-only behaviour is an automatic http -> https redirection performed by the GAE infra on behalf of the app if secure: always is set in the app.yaml configuration file.

但是,对于灵活的环境GAE应用程序,实际上已经弃用了该配置.特定于PHP的弃用说明可在 app.yaml中找到更改:

But that configuration has, indeed, been deprecated for the flexible environment GAE apps. The PHP-specific deprecation note can be found at app.yaml changes:

  • 安全处理程序
  • Secure handlers

此应用程序已弃用handlers下的secure设置 引擎灵活的环境.如果您需要SSL重定向,则可以 更新您的应用程序代码,并使用X-Forwarded-Proto标头 重定向http流量.您还可以使用 HTTP严格传输 安全响应标头.

The secure setting under handlers is now deprecated for the App Engine flexible environment. If you need SSL redirection, you can update your application code and use the X-Forwarded-Proto header to redirect http traffic. You can also use the HTTP Strict Transport Security response header.

您还将注意到,在secure(或有关此问题的handlers) /reference/app-yaml"rel =" nofollow noreferrer> app.yaml配置文件文档.

You'll also note that there is no mentioning of secure (or handlers for that matter) in the app.yaml Configuration File doc.

因此,您需要在应用程序代码(或用于它的框架,如果有的话,并且具有此功能)中照顾到http-> https重定向,可能要遵循上面的建议引用.我不是PHP用户,因此我真的无法提供详细信息.

So you need to take care of the http -> https redirection inside your app code (or the framework you use for it, if any and if it has such capability), possibly following the suggestions from the above quote. I can't really help with details on this as I'm not a PHP user.

这篇关于正确地将仅HTTPS自定义域分配给flex env的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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