1
votes

I have just set up a custom domain for my Google App Engine, using a domain I bought from GoDaddy. Then I transferred the nameservers to Cloud DNS and inserted the DNS records as the cloud documentation suggested into the cloud DNS record set, and it is working fine.

However, the problem is that when I use the custom domain, it doesn't default to the HTTPS version of the site, I have to manually type in HTTPS (ie I can't just go to example.com, I have to go to https://example.com).

What could I be doing wrong here?

Thank you!

2
You haven't indicated if you followed the instructions or the troubleshooting steps in the documentation. - BrettJ

2 Answers

5
votes

App Engine standard environment

Add the following two lines to your app.yaml:

secure: always
redirect_http_response_code: 301

App Engine flexible environment

You will need to setup HTTPS redirects from within your web server app. Each server node.js, django, Flask, etc. has their own method of handling HTTPS as the only protocol.

1
votes

For rookies like myself :- In app.yaml file you already have first 2 lines of following code. Add last to lines under it:

- url: /.*  
  script: auto  
  secure: always  
  redirect_http_response_code: 301

Reference : app.yaml file documentation All urls will get redirected for https secure connections