Skip to content

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.

FieldDescription
DATEDate the error was logged.
TIMETime the error was logged.
LOG_LEVELPriority of the log entry. See the Nginx log_level documentation for possible values.
PROCESS_IDNginx process ID that generated the log message.
THREAD_IDNginx thread ID that generated the log message.
LOG_MESSAGELog 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.

Terminal window
sudo tail -n 100 /var/log/nginx-sp/error.log