While configuration can be tested with command
There is a command
Command to test and reload if it's ok:
#nginx #test #configtest
service nginx configtest
, there is a more convenient way to do this - and immediately get whats wrong. There is a command
nginx -t
, which test configuration and display error messages. Both commands must be used with sudo or permission denied messages might be shown (regarding SSL certificates for example).Command to test and reload if it's ok:
sudo nginx -t && sudo service nginx reload
#nginx #test #configtest