Nginx service logs
The Nginx service log contains errors, warnings, and informational messages generated by Nginx during startup, shutdown, or while running.
View the logs
The Nginx service log can be viewed from within the ServerPilot dashboard or through SSH.
Log file location
The Nginx service log is located at:
/var/log/nginx-sp/error.log
Log file format
The format of each entry in the Nginx service log is:
DATE TIME [LOG_LEVEL] PROCESS_ID#THREAD_ID: LOG_MESSAGE
For example:
2025/03/07 10:27:37 [emerg] 27279#0: unknown directive "example_invalid_directive" in /etc/nginx-sp/nginx.conf:11
The fields in each log entry are described in the following table.
Field | Description |
---|---|
DATE | Date the error was logged. |
TIME | Time the error was logged. |
LOG_LEVEL | Priority of the log entry. See the Nginx log_level documentation for possible values. |
PROCESS_ID | Nginx process ID that generated the log message. |
THREAD_ID | Nginx thread ID that generated the log message. |
LOG_MESSAGE | Log message content. |
Example commands
You must be logged in as root
to view the Nginx service log.
View recent Nginx service log entries
Show the most recent 100 lines in the Nginx service log.
sudo tail -n 100 /var/log/nginx-sp/error.log