nginx Nginx Configurations Test NGINX configuration file


You can check for syntax errors and referenced files in an NGINX configuration file before running it with:

nginx -t

Alternatively you can run service script

service nginx configtest

While both of these commands will tell you if your new nginx configuration is ok [without killing your current instance]. Configtest uses the running service and tells you if it passes or fails the check whereas nginx -t will not only check the config but print any info, warning as well as error messages.