# Proxy Setting
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Cache Server
proxy_cache_path /data/proxy_cache levels=1:2 keys_zone=cache_one:30m inactive=10d max_size=10G;
location / {
proxy_pass http://www.adj.idv.tw;
proxy_buffering on;
proxy_cache cache_one;
proxy_cache_valid 200 304 7d;
proxy_cache_valid 301 302 10m;
proxy_cache_valid any 1m;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
add_header X-Via $server_addr;
add_header X-Cache-status $upstream_cache_status;
expires 7d;
}
# curl -I http://www.xxx.com.tw
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 12 Feb 2015 07:21:13 GMT
Content-Type: text/html; charset=utf8
Connection: keep-alive
Last-Modified: Tue, 11 Jun 2013 02:12:56 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Expires: Thu, 19 Feb 2015 07:21:13 GMT
Cache-Control: max-age=604800
X-Via: xx.xx.xx.xx
X-Cache-status: HIT
歡迎光臨 ADJ網路實驗室 (http://dz.adj.idv.tw/) | Powered by Discuz! 6.0.0 |