在Google Cloud中从http重定向到https [英] Redirect from http to https in google cloud

查看:144
本文介绍了在Google Cloud中从http重定向到https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在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屋!

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