How to verify if nginx is running or not?

Zameer Ansari picture Zameer Ansari · Feb 5, 2016 · Viewed 94.3k times · Source

After running an ASP.NET vNext project on my local machine I was trying to figure out how I can run it on nginx as it looks to be a recommended choice

Following jsinh's blog, I installed it using:

sudo apt-get update
sudo apt-get install nginx -y

I was trying to understand whether it is working or not by using:

ifconfig eth0 | grep inet | awk '{ print $2}'

After running

sudo service nginx start
sudo service nginx stop

However, the output is always the same:

Nginx status

How to verify if nginx is running or not?

Answer

user5790799 picture user5790799 · Feb 16, 2016

Looking at the requirement you have, the below command shall help:

service nginx status