没人知道吗?
下面是 完整的 规则, 就是 无法生成缓存!目录权限什么的 没问题。貌似不知道怎么改了一下 目录下生成一个缓存文件过,但是 反代网站与实际填写的网站内容不一样!所以还是失败。。。。
client_body_buffer_size 512k;
proxy_connect_timeout 5;
proxy_read_timeout 60;
proxy_send_timeout 5;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
proxy_cache_path /home/cache/path levels=1:2 keys_zone=cache_one:500m inactive=7d max_size=30g;
server
{
listen 80;
#listen [::]:80;
server_name
jp.xz.baidu.com.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/jp.xz.baidu.com.com;
include none.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
proxy_temp_path /home/cache/temp;
proxy_cache_key $scheme://$host$request_uri;
proxy_cache_valid 200 304 3h; #cache_valid end
proxy_connect_timeout 60s; #connect_timeout end
location / {
default_type text/html;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Referer
http://baidu.com.com; #header_referer end
proxy_set_header Host
baidu.com.com; #header_host end
proxy_pass
http://42.128.8.8; #proxy_pass end
proxy_set_header Accept-Encoding "";
}
}