Appengine HTTPS安全:始终会导致CloudFlare发生重定向循环

问题描述 投票:1回答:1

[将app.yaml设置为始终安全时,我尝试加载网站的HTTP或https版本时无休止的302重定向。

application: xxx
version: 1
runtime: python27
api_version: 1
threadsafe: true

default_expiration: "200d"

handlers:

- url: /favicon.ico
  static_files: favicon.ico
  upload: favicon.ico

- url: /robots.txt
  static_files: robots.txt
  upload: robots.txt

- url: /fonts
  static_dir: fonts

- url: /styles
  static_dir: styles

- url: /scripts
  static_dir: scripts

- url: /images/(.*\.(gif|png|jpg|svg))$
  static_files: images/\1
  upload: images/.*\.(gif|png|jpg|svg)$

- url: /.*
  static_files: index.html
  upload: index.html
  secure: always

这是一个有角度的应用程序,因此我要处理index.html上的所有URL

browser redirects

network inspector

appengine logs

curl -L --dump-header /tmp/head example.org

HTTP/1.1 302 Found
Server: cloudflare-nginx
Date: Wed, 23 Dec 2015 13:57:32 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d82f41e169b9140f8a0e3cb1b2ac5b1de1450879051; expires=Thu, 22-Dec-16 13:57:31 GMT; path=/; domain=.example.org; HttpOnly
Location: https://example.org/
CF-RAY: 2594937966dd18c1-GRU

... 48 more of these ...

HTTP/1.1 302 Found
Server: cloudflare-nginx
Date: Wed, 23 Dec 2015 13:57:32 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d82f41e169b9140f8a0e3cb1b2ac5b1de1450879051; expires=Thu, 22-Dec-16 13:57:31 GMT; path=/; domain=.example.org; HttpOnly
Location: https://example.org/
CF-RAY: 2594937966dd18c1-GRU

curl -L --dump-header /tmp/head myppid.appspot.com

HTTP/1.1 302 Found
Location: https://myppid.appspot.com/
Date: Tue, 22 Dec 2015 18:20:23 GMT
Content-Type: text/html
Server: Google Frontend
Content-Length: 0

HTTP/1.1 200 OK
Date: Tue, 22 Dec 2015 18:20:23 GMT
Expires: Sat, 09 Jul 2016 18:20:23 GMT
Cache-Control: public, max-age=17280000
ETag: "0tVHeg"
Content-Type: text/html
Server: Google Frontend
Content-Length: 11144
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"

Cloudflare通过以下SSL选项位于我的appengine应用程序前面:

cloudflare setting

那么这是怎么回事?我是否需要向AppEngine中添加SSL证书并将SSL模式切换为完全模式才能使其正常工作?我不明白为什么在通过CloudFlare时将其重定向到http,然后重定向到https。

angularjs google-app-engine redirect https cloudflare
1个回答
0
投票

我知道为您回答这个问题真的很晚,但是我刚刚遇到了这个确切的问题,我想分享解决方案,以便其他人可以在这里找到它。

仅从Cloudflare概述选项卡中暂停并重新启用站点的Cloudflare可以为我解决此问题。

© www.soinside.com 2019 - 2024. All rights reserved.