Nginx not running but erpnext seems to be working fine


After my new installation of erpnext I tried to restart nginx but it failed.
However, erpnext itself seems to be running fine.

I can reload the nginx configuration file with command “sudo service nginx reload” which give me success.
But nginx itself won’t run. I have checked the configuration file using command “sudo nginx -t” and it shows that the configuration file doesn’t contain any error.

So can erpnext run even if nginx is not running? How can I make it run?


is it running?
sudo service nginx status

To start it,

sudo service nginx start

1 Like

When I run command
“sudo service nginx start”
it doesn’t give me any message.
But when I use the command
“sudo service nginx status”
It says the nginx is not running.

what is the output of sudo service nginx configtest?

It says Ok.
Configtest doesn’t give any error.

Check nginx log, /var/log/nginx/error.log

A yesterdays entry says “a duplicate default server for in /etc/nginx/sites-enabled/default:21”
But after that I have removed the file named “default” from sites-enabled and have also regenerated the config file using bench setup nginx and replaced the config file.
Now it is not giving any error. But nginx won’t start.

Ok. I think I changed the log file location. So now the error I am getting is 90: Address already in use.
There is nothing else listening on port 80. The output I get with ‘sudo netstat -tupln’ shows nginx listening on Local address tcp and tcp6 :::80
I have tried several times by reloading the configuration and restarting the system. But I am getting the same error every time.

Can erpnext work even if nginx is not running?

Sorry. The error number is 98: Address already in use and not 90.

what is the output of curl -I localhost?

root@satishubuntu:/home/satish# curl -I localhost
HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Tue, 11 Nov 2014 13:32:38 GMT
Content-Type: text/html; charset: utf-8
Content-Length: 10323
Connection: keep-alive
X-Page-Name: acme-stones-pvt-ltd
X-From-Cache: True
Set-Cookie: sid=Guest; Expires=Fri, 14-Nov-2014 19:02:38 GMT; Path=/

This means that nginx is running. You might have to check routing / port forwarding.

I uninstalled and reinstalled nginx. Now it is working fine.