web服务器的访问日志是非常重要的,我们可以通过访问日志来分析用户的访问情况,

也可以通过访问日志发现一些异常访问,比如cc攻击。

  格式: access_log /path/to/logfile format;

access_log可以配置到http, server, location配置段中。

 

配置示例:

server 
{
    listen 80;
    server_name www.xxx.com;
    root /data/wwwroot/www.xxx.com;
    index index.html index.php;
    access_log /data/logs/www.xxx.com_access.log main;
}
说明:若不指定log_format,则按照默认的格式写日志,main为默认的日志格式。

 

相关文章:

  • 2021-08-04
  • 2022-12-23
  • 2021-10-07
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
猜你喜欢
  • 2021-10-04
  • 2022-03-09
  • 2022-02-19
  • 2021-11-27
  • 2021-06-12
  • 2021-11-29
相关资源
相似解决方案