• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

nginx的proxy_cache如何配的?老出错

php 搞代码 3年前 (2022-01-24) 13次浏览 已收录 0个评论

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 /><a style="color:transparent">本@文来源gao($daima.com搞@代@#码(网5</a><strong>搞gaodaima代码</strong>			}<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 />

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


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:nginx的proxy_cache如何配的?老出错
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址