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
| Name | Type | Description |
|---|---|---|
| prefix | path | Lab prefix |
| file | path | Selected configuration |
Working Example
Example Snippetnginx
nginx -e stderr -p "$LAB/" -c "$LAB/nginx.conf" -t