Home > Operation and Maintenance > Nginx > How to configure nginx log access_log

How to configure nginx log access_log

WBOY
Release: 2023-05-30 18:28:06
forward
2615 people have browsed it

The access log of the web server is very important. We can analyze the user's access through the access log.

We can also find some abnormal access, such as cc attacks, through the access log.

Format: access_log /path/to/logfile format;

access_log can be configured in the http, server, and location configuration sections.

Configuration example:

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为默认的日志格式。
Copy after login

The above is the detailed content of How to configure nginx log access_log. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template