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

3

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" Dec 30, 2012 at 20:57
  • I'd look into signals for config reload, they're rather typical.
    – gparent
    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. Dec 30, 2012 at 21:32
  • Does reload imply worker process to change id? 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
    – faker
    Dec 31, 2012 at 0:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.