Which 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!