nginx的proxy_cache怎么配的??老出错
<br /> nginx.conf<br /> http{<br /> ...<br /> proxy_temp_path /data/proxy_temp_path<br /> proxy_cache_path /data/proxy_cache_path levels=1:2 key_zone=cache_one:200m inactive=1d max_size=1g<br /> ## /data/proxy_temp_path/data/proxy_cache_path都存在。<br /> }<br /> default.conf <br /> server {<br /> location / {<br /> ...<br /> proxy_cache cache_one; #使用cache_one这个keys_zone<br /> proxy_cache_valid 200 301 302 1d; #200,301,302状态码保存1小时<br /> proxy_cache_valid any 1h; #其它的保存一小时<br /> }<br /> location ~ .*\.(gif|jpg|png|txt|htm|html|css|js|flv|ico|swf)(.*) {<br /> expires 6h; #设置浏览器过期时间<br /> proxy_redirect off;<br /> proxy_set_header Host $host;<br /> proxy_cache cache_one;<br /> proxy_cache_valid 200 301 302 1d;<br /> proxy_cache_valid any 1d;<br /> expires 30d;<br /> }<br /> }<br />
<br />[[email protected] nginx]# service nginx restart<br />nginx: [emerg] invalid number of arguments in "proxy_temp_path" directive in /etc/nginx/nginx.conf:39<br />nginx: configuration file /etc/nginx/nginx.conf test failed<br />