How to enforce HTTPS traffic to Google App Engine with custom domain?

前端 未结 4 991
说谎
说谎 2020-12-18 00:29

I have a site on Google Domains (www.example.com) and it\'s hosted with Gcloud. I followed the instructions listed here to set up SSL and https: https://cloud.google.com/app

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-18 00:48

    Have you tried setting secure: always in your handlers in your app.yaml?

    handlers:
    - url: /youraccount/.*
      script: accounts.app
      login: required
      secure: always
    

    always

    Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are preserved for the redirect

    https://cloud.google.com/appengine/docs/standard/python/config/appref#handlers_element

提交回复
热议问题