0

I am trying to enable https for my website which I am running in google cloud app engine. I have google managed free certificate and my problem is, both of the urls "http://www.mydomain.ca" and "https://www.mydomain.ca" are working. I want to redirect users to the "https" url and I am using python-flask in back-end. I am looking for most convenient way to do it. thanks!

  • 1
    Does this answer your question? [How to convert http to https using nginx for local server(self signed cetificate)](https://stackoverflow.com/questions/23544455/how-to-convert-http-to-https-using-nginx-for-local-serverself-signed-cetificate) – Chuck Jun 25 '20 at 16:29
  • App Engine Standard or Flexible? Standard supports the `secure: always` option. For Flex look at this question: https://stackoverflow.com/questions/32237379/python-flask-redirect-to-https-from-http – John Hanley Jun 25 '20 at 23:16
  • @John I believe your comment should actually be the answer to this post? it will be helpful for other community members with the same issue. Doc for secure:always is https://cloud.google.com/appengine/docs/standard/python/config/appref#handlers_element – JC98 Jun 29 '20 at 22:22

1 Answers1

0

If the application is hosted on App Engine Standard environment then you can use the Secure: Always configuration on the app.yaml file to redirect traffic to https.

If the app is on Flexible environment you will need to use a code-level redirect approach.

JC98
  • 604
  • 5
  • 9