簡體   English   中英

AppEngine Nodejs 不將 HTTP 重定向到 HTTPS

[英]AppEngine Nodejs not redirecting HTTP to HTTPS

我已經設置了我的app.yaml文件,如下所示:

runtime: nodejs10
handlers:
  - url: /.*
    script: auto
    secure: always
    redirect_http_response_code: 301
  # Serve all static files with urls ending with a file extension
  - url: /(.*\..+)$
    static_files: dist/\1
    upload: dist/(.*\..+)$
    # catch all handler to index.html
  - url: /.*
    static_files: dist/index.html
    upload: dist/index.html

這對 Flask 項目有效,但對於我的 Nodejs 項目,它似乎不起作用。 我是否需要將script: auto更改為其他內容?

您需要向需要此行為的每個處理程序添加secure: always 請注意,您有兩個具有相同功能的處理程序- url: /.* 該 url 的最后一個定義沒有secure參數。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM