nginx -t -c /etc/nginx/nginx.conf

Category: Web Servers & Proxies

nginx -t -c /etc/nginx/nginx.conf

Test a specific nginx config file for errors

Runs a syntax check on the named configuration file and everything it includes, without starting nginx. Reports the file and line number of any problem, so you can fix errors before reloading a live server. Plain nginx -t tests the default config path.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.