HostOnNet Blog

Testing Nginx Configuration file

Looking for Linux Server Admin or WordPress Expert? We can help.

When you edit nginx coniguration file, it is better to test the new config file before you restart. This can be done with command

nginx -t

Example

root@ip-172-31-0-223:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@ip-172-31-0-223:~#

You can also use command

service nginx configtest

See also nginx

Posted in Web Server

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.