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

How to view nginx logs

步履不停
步履不停Original
2019-06-22 11:34:0912655browse

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

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;     (这是查看错误日志文件的位置)
}

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

   service nginx restart     重启

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

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!

Statement:
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