Managing Nginx - wollardj/Mandrill GitHub Wiki

While Nginx is a full-featured web server, much like Apache, we're not really utilizing it the same way in this guide. All we're really doing is using Nginx to listen on port 80 and broker the incoming requests for us, passing them along to our node server running on port 3001. Why not just configure pm2 to run Mandrill's node server on port 80? Because NodeJS servers are not as well tuned to handling and queuing high traffic as Nginx is.

Whether on Ubuntu or CentOS, you can start, stop or restart Nginx the same way:

# 'status'
sudo /etc/init.d/nginx status
nginx (pid  55955) is running...


# 'stop'
sudo /etc/init.d/nginx stop
Stopping nginx:                                            [  OK  ]


# 'start'
sudo /etc/init.d/nginx start
Starting nginx:                                            [  OK  ]


# 'restart'
sudo /etc/init.d/nginx restart
Stopping nginx:                                            [  OK  ]
Starting nginx:                                            [  OK  ]


# 'configtest'
sudo /etc/init.d/nginx configtest
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful