【问题标题】:How to configure Google App Engine app.yaml file to force https如何配置 Google App Engine app.yaml 文件以强制 https
【发布时间】:2022-01-24 05:40:39
【问题描述】:

如何强制所有 domain.tld 和 www.domain.tldhttps://domain.tld?我能够靠近。如果我通过注释行取消注释,它将强制执行所有操作,但我的静态文件夹中的所有内容都无法访问。

runtime: php74
env: standard
entrypoint: serve public/index.php

handlers:

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

- url: /static
  static_dir: static

【问题讨论】:

    标签: google-app-engine yaml


    【解决方案1】:

    你需要这个:

    runtime: php74
    env: standard
    entrypoint: serve public/index.php
    
    handlers:
    
    - url: /static
      static_dir: static
    
    - url: /.*
      script: auto
      secure: always
      redirect_http_response_code: 301
    

    顺序很重要,因为使用的是第一个匹配规则。

    【讨论】:

    • 我不知道!非常感谢您抽出宝贵时间回复。
    猜你喜欢
    • 2020-12-28
    • 2011-04-23
    • 1970-01-01
    • 2019-03-19
    • 2014-10-10
    • 2019-06-06
    • 1970-01-01
    • 2012-11-19
    • 1970-01-01
    相关资源
    最近更新 更多