After modifying the configuration files for nginx, type
sudo nginx -t
to check for any syntax errors.
sudo nginx -s reload
to reload the configuration files and
sudo service nginx restart
OR
sudo /etc/init.d/nginx restart
OR
sudo systmctl restart nginx
to restart nginx for the changes to take effect.