Command Line

NGINX is a free, open-source, high-performance HTTP server. NGINX usage has been growing in the past few years and you should at least learn some commands that you could use with NGINX.

First, Install NGINX

Debian/Ubuntu

apt-get install nginx

CentOS/RHEL

yum install nginx

Now, let’s get to the essential commands

Check NGINX status

$ service nginx status
$ service nginx status
nginx found running with processes:  15423 15422 15421 15420 15418 15417 15416 15414 15412

Stop NGINX

$ service nginx stop
$ service nginx stop
 * Stopping Nginx Server...                                                                                                                            [ OK ]

Start NGINX

$ service nginx start
$ service nginx start
 * Starting Nginx Server...                                                                                                                            [ OK ] 

Restart NGINX

This will do the above commands, stop and start

$ service nginx start
$ service nginx restart
 * Stopping Nginx Server...                                                                                                                            [ OK ] 
 * Starting Nginx Server...                                                                                                                            [ OK ] 

Reload NGINX Configuration

$ service nginx reload
$ service nginx reload
nginx: the configuration file /etc/conf/nginx.conf syntax is ok
nginx: configuration file /etc/conf/nginx.conf test is successful
 * Reloading (via HUP) Nginx Server...                                                                                                                        
Hangup

Come on and try these commands out on environment!