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

How to configure nginx log access_log

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-05-30 18:28:06
forward
2662 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:
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
Latest Issues
Error restarting nginx
From 1970-01-01 08:00:00
0
0
0
server - Nginx configuration webapp problem
From 1970-01-01 08:00:00
0
0
0
Nginx default.conf problem
From 1970-01-01 08:00:00
0
0
0
centos7 - NGINX exception occurs
From 1970-01-01 08:00:00
0
0
0
nginx load balancing
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template