![Nginx Access.log 状态结果根据不同的文件](https://linux22.com/image/1437063/Nginx%20Access.log%20%E7%8A%B6%E6%80%81%E7%BB%93%E6%9E%9C%E6%A0%B9%E6%8D%AE%E4%B8%8D%E5%90%8C%E7%9A%84%E6%96%87%E4%BB%B6.png)
nginx 访问日志,
我想要做
状态=“200” access_log /var/log/access.log主要;
状态=“444”访问日志/var/log/access444.log主要;
状态=“401”访问日志/var/log/access401.log主要;
这能做到吗?
谢谢
服务器 { 监听 5026; 服务器名称 wwwww;
if ($allowed_country = no) {
返回 444; }
if ($http_user_agent ~* "mozilla" ) {return 403; }
error_page 403 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location = / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/users/user;
limit_conn peruser 2;
proxy_pass http://localhost:9025;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log /var/log/access.log main;
}
}