的配置錯誤是你的服務器上,而不是CloudFront的。
如果我連接到您的www
服務器,但隨後騙它,告訴它我要求img
而不是www
通過設置HTTP頭Host:
(這是當它獲取內容是什麼CloudFront的是做,如果你有Host:
頭中的緩存行爲列入白名單),您的服務器沒有在這種情況下即使它(返回Cache-Control
頭兩次!)當請求針對www
。
這是你的服務器的連接,而不是CloudFront的:
$ curl -v https://www.fanaticguitars.com/v2/avatar.png -H 'Host: img.fanaticguitars.com' > /dev/null
> GET /v2/avatar.png HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Accept: */*
> Host: img.fanaticguitars.com
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Thu, 09 Mar 2017 16:49:31 GMT
< Content-Type: image/png
< Content-Length: 9915
< Last-Modified: Wed, 01 Mar 2017 21:46:59 GMT
< Connection: close
< Accept-Ranges: bytes
<
* Closing connection #0