在Google Cloud中从http重定向到https [英] Redirect from http to https in google cloud
问题描述
我已经在Node.js环境的Google Cloud上部署了一个站点.我想将用户从http重定向到https,因为我想将https设置为默认值. 我已经将SSL证书附加到App引擎中的自定义域中,并且工作正常. 我还尝试了从节点重定向到https,但是在Google Cloud上没有工作.
I have deployed a site on google cloud on Nodejs environment. I want to redirect the user from http to https as i want to make https as default. I have already attached SSL certificate with my custom domain in App engine and it is working fine. I also tried to redirect to https from node but none is working on google cloud.
如果事情不起作用,我对云的了解就会减少,然后我必须迁移到Heroku.
I am having less knowledge of cloud if things did not work then i have to migrate to Heroku.
推荐答案
您必须在app.yaml
handlers:
- url: /.*
script: IGNORED
secure: always
请参见 https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml#security
这篇关于在Google Cloud中从http重定向到https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!