Redirect from http to https in google cloud

安稳与你 提交于 2020-01-05 03:48:10

问题


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.

I am having less knowledge of cloud if things did not work then i have to migrate to Heroku.


回答1:


You have to setup it in your app.yaml

handlers:
- url: /.*
  script: IGNORED
  secure: always

See https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml#security



来源:https://stackoverflow.com/questions/37135051/redirect-from-http-to-https-in-google-cloud

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!