在将app安全设置为始终在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上的所有网址
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位于我的appengine应用程序前面,带有以下SSL选项:
那么这里发生了什么?我是否需要向AppEngine添加SSL证书并将SSL模式切换为完全以使其正常工作?我不明白为什么它会重定向到http,然后在通过CloudFlare时返回到https。