Correctly assign HTTPS only custom domain to flex env

后端 未结 1 1613
余生分开走
余生分开走 2021-01-28 15:13

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

I\'ve added the custom domain, set up all the DNS records etc. and it is working! But how do

相关标签:
1条回答
  • 2021-01-28 15:29

    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).

    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.

    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

    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.

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

    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.

    0 讨论(0)
提交回复
热议问题