Review NGINX error log
NGINX is often used as a web server (in place of Apache) to speed up the performance of a website. It is used, like PHP-FPM, to better utilize resources on heavy traffic sites.
Why would I need to review this log?
- Your site is not working as intended.
- Your site is intermittently showing errors.
- Your site is slow or just spins and never loads.
How can I review this log?
SSH allows you to access, view and manipulate the full log with tools such as vim or grep.
Example errors found in a NGINX log
2022/01/22 03:39:16 [error] 1032#1032: *221720 upstream prematurely closed connection while reading response header from upstream, client: 10.22.189.173, server: acoolexample.server, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5003/", host: "acoolexample.com"
2021/09/27 09:10:09 [error] 31358#31358: *607 FastCGI sent in stderr: "PHP message: PHP Warning: fopen(/usr/share/nginx/package/learning-platform-38/learning-platform-prod/wp-content/uploads/wp-file-manager-pro/fm_backup/index.php): failed to open stream: No such file or directory in /usr/share/nginx/package/learning-platform-38/learning-platform-prod/wp-content/plugins/wp-file-manager/file_folder_manager.php on line 59PHP message: PHP Warning: fclose() expects parameter 1 to be resource, bool given in /usr/share/nginx/package/learning-platform-38/learning-platform-prod/wp-content/plugins/wp-file-manager/file_folder_manager.php on line 60" while reading response header from upstream, client: 10.39.68.231, server: acooldomain.server, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "learning.acooldomain.com"
2021/07/01 00:15:04 [error] 1340#0: *490 open() "/usr/share/nginx/html/nginx_status" failed (2: No such file or directory), client: 127.0.0.1, server: _, request: "GET /nginx_status HTTP/1.1", host: "localhost"