AMH 社区首页
AMH社区 - 开放自由有价值的社区
[求助帖] amproxy反代开启access_log如何指定只纪录某后端的文件 |
|
---|---|
wee |
wee 发表于 2015-09-26 03:24:37
我想把access_log只纪录php和htm的l文件,其馀以外一律不纪录,请问应该是怎麽写啊?
我尝试加access_log off;但是这样会影响缓存文件,反效果不会缓存! server {
listen 80; server_name www.domain.com; index index.php index.html index.htm; location / { default_type text/html; proxy_cache amproxy; subs_filter_types text/css text/xml; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Referer http://www.domain.com; proxy_set_header Host www.domain.com; proxy_pass http://www.domain.com; proxy_set_header Accept-Encoding ""; } access_log /home/amproxy_cache_logs/access.log combined; #access_log end error_log /home/amproxy_cache_logs/error.log crit; #error_log end }
点赞,加油! (0分)
2015-09-26 03:24:37 1
|
amysql |
加一个if匹配看看,
if ($uri ~ .*\.(php|html)$ )
回复
2015-10-12 09:45:44 2
AMH面板 - 好用高效低占用、安全可靠极稳定 |
wee |
access_log好像不能放在if里面 nginx: [emerg] "access_log" directive is not allowed here in /usr/local/nginx/conf/proxy/
回复
2015-10-21 19:27:24 3
|