2013-04-29 5 views
0

3 분 동안 모든 파일을 캐시하도록 nginx를 구성했습니다. 이것은 수동으로 웹 서버에 업로드하는 파일에만 적용됩니다. CMS에 의해 생성 된 모든 파일은 영원히 캐싱됩니다. (또는 기다리지 않은 오랜 시간) ...Nginx 캐시가 새로 고침되지 않습니다.

CMS는 모든 페이지를 고유 한 폴더 구조 (www.x.de/)로 "index.html" category1/category2/articlename/index.html).

어떻게 디버깅 할 수 있습니까? 특정 파일의 수명을 확인하는 방법이 있습니까? .html 파일의 내용이 proxy_cache_valid 값을 덮어 쓸 수 있습니까?

감사합니다.

구성 :

server { 
listen 1.2.3.4:80 default_server; 

server_name x.de; 
server_name www.x.de; 
server_name ipv4.x.de; 


client_max_body_size 128m; 
location/{ # IPv6 isn't supported in proxy_pass yet. 
proxy_pass http://apache.ip:7080; 
proxy_cache my-cache; 
proxy_cache_valid 200 3m; 
proxy_cache_valid 404 1m; 
proxy_set_header Host $host; 
proxy_set_header X-Real-IP $remote_addr; 
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
proxy_set_header X-Accel-Internal /internal-nginx-static-location; 
access_log off; 

} 

location /internal-nginx-static-location/ { 
alias /var/www/vhosts/x.de/httpdocs/cms/; 
access_log /var/www/vhosts/x.de/statistics/logs/proxy_access_log; 
add_header X-Powered-By PleskLin; 
internal; 
}} 

답변

0

curl -I를 사용하면 캐시 설정이 무엇인지를 알려줍니다 헤더를 검색 할 수 있습니다.

예.

>>> curl -I http://www.google.com 
HTTP/1.1 200 OK 
Date: Sun, 09 Feb 2014 06:28:36 GMT 
Expires: -1 
Cache-Control: private, max-age=0 
Content-Type: text/html; charset=ISO-8859-1 
Server: gws 
X-XSS-Protection: 1; mode=block 
X-Frame-Options: SAMEORIGIN 
Transfer-Encoding: chunked 

캐시 설정은 응답 헤더에서 이루어 지므로 html로 수정할 수 없습니다.