0

I tried to run a "nginx -c /etc/nginx/nginx.conf" but I got:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] still could not bind() [Exit 1] 

Then I run a

 fuser -k 80/tcp ; service nginx restart. 

I tried again with "nginx -c /etc/nginx/nginx.conf" but still the same error "[emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)"

Why is this happening?

1 Answer 1

5

This is not how you reload nginx.
What you are trying is starting nginx again, -c just specifies the configuration file it should use.
Use service nginx reload or /etc/init.d/nginx reload to reload it.

5
  • Ops I thought it was the command to reload the config "silently" Commented Dec 30, 2012 at 20:57
  • I'd look into signals for config reload, they're rather typical. Commented Dec 30, 2012 at 21:08
  • 1
    SIGHUP is the silent reload signal for NGINX (on the master process). but using 'reload' attribute to the init.d script is easier for most. Commented Dec 30, 2012 at 21:32
  • Does reload imply worker process to change id? Commented Dec 30, 2012 at 23:52
  • 1
    Depends on the actual init script, but usually it is also just sending SIGHUP. For more information on what happens, see here: nginx.org/en/docs/control.html Commented Dec 31, 2012 at 0:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.