Home >Backend Development >PHP Tutorial >nginx的proxy_cache如何配的?老出错

nginx的proxy_cache如何配的?老出错

WBOY
WBOYOriginal
2016-06-13 12:13:111257browse

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&#160;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 />

------解决思路----------------------
请问你的第一问题是如何解决的,我也碰到了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn