nginx proxy_cache proxy_store 源服务器挂了以后代理也一起挂
proxy_cache_path /var/cache/nginx/www.hs2v.comlevels=1:2 keys_zone=www.hs2v.com:1m inactive=10m max_size=10m;proxy_temp_file_write_size 16k;
server {
listen 80;
server_namewww.hs2v.com;
location / {
root /home/www/www.hs2v.com;
client_max_body_size 10m;
proxy_pass http://192.168.1.2/;
proxy_redirect http://192.168.1.2/ /;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
#proxy_cache www.hs2v.com;
proxy_store on;
proxy_cache_valid 200 15m;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_connect_timeout 5s;
proxy_intercept_errors on;
proxy_temp_path /var/cache/nginx/www.hs2v.com_temp 1 2;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
proxy_hide_header Cache-Control;
proxy_hide_header Set-Cookie;
proxy_hide_header Expires;
proxy_hide_header X-Accel-Expires;
}
}
怎么才能让代理读取缓存里的内容,而不是去找源机? 后端一死,前端跟着死,怎么破? 自已学编程自已破 反代那些反代了loc不会挂的站
天蓝色的忧伤 发表于 2017-9-17 21:29
反代那些反代了loc不会挂的站
我自己家里的机器,怎么可能不死
没给cache时间 设定缓存时间
总有刁民想害朕 发表于 2017-9-24 13:23
设定缓存时间
是哪个命令?
suwubee 发表于 2017-9-17 21:46
没给cache时间
expire 吗?
查无此人 发表于 2017-9-24 18:35
expire 吗?
是的
页:
[1]