CLI options

nginx -t configuration test

Checks configuration before startup or reload; does not establish HTTP behavior. Use reviewed lab files and prepare all directories. Exits after test.

Formal Syntax & Structure

nginx syntaxnginx
nginx -t [-p prefix] [-c file]

Parameters & Attributes

NameTypeDescription
prefixpathLab prefix
filepathSelected configuration

Working Example

Example Snippetnginx
nginx -e stderr -p "$LAB/" -c "$LAB/nginx.conf" -t
Nginx Reference