Core directives

pid directive

Sets the file holding the master process ID. Context: main. Upstream documented default is logs/nginx.pid; compiled package defaults may differ. Relative path is resolved with the prefix. Partial lab snippet.

Formal Syntax & Structure

nginx syntaxnginx
pid file;

Parameters & Attributes

NameTypeDescription
filestringPID file path

Working Example

Example Snippetnginx
pid logs/nginx.pid;
Nginx Reference