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