Home > Operation and Maintenance > Nginx > How to view nginx logs

How to view nginx logs

步履不停
Release: 2019-07-10 13:16:50
Original
12868 people have browsed it

How to view nginx logsWhich page you need to visit to check errors can be configured under the configured domain name

For example:

1. First find the file to be configured and then edit it

# vim ×××××.××××.×××.conf
Copy after login

2. After entering, write in the server

server {
        access_log /data/log/www;
        listen 80;
        server_name abc.com www.abc.com;
        location / {
                root /data/www/www;
                index index.html index.htm;
        }
        error_log    logs/error_www.abc.com.log    error;     (这是查看错误日志文件的位置)
}
Copy after login

3.nginx -t Check if Nginx has errors. Restart only if no errors are reported

   service nginx restart     重启
Copy after login

4. Then run If an error is reported on the page, go directly to the error log to view it

直接    # vim logs/error_www.abc.com.log
Copy after login

For more Nginx related technical articles, please visitNginx Tutorial column to study!

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

Related labels:
source:php.cn
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