问题
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