Nginx / OpenResty

Nginx / OpenResty: nginx -t — Linux

Validate configuration syntax before reloading.

Availability: Tool and version dependent; install separately where required.中文

Syntax

nginx -t

Examples

Validate configuration syntax before reloading.

nginx -t

Parameters, options and clauses

Option / clauseDescription
-tTest the configuration and try to open referenced files.
-c <file>Select the configuration file.
-p <prefix>Set the server path prefix.
-qSuppress non-error messages during the test.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory