If your Nginx encounters an error after a change has been made to any Nginx configuration file, you can use this command to check whether the Nginx configuration is still okay or vice versa.
$ sudo nginx -t
If your Nginx configuration is correct or has no error, Nginx will return the following output in your terminal:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: the configuration file /etc/nginx/nginx.conf test is successful