0

I'm having a heck of an issue here. I have nginx & varnish installed. Configured nginx to listed on port 8080, and varnish to listen on port 80

nGinx will not start due to

Jul 06 16:26:36 host nginx[2863]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

I have grep'd my entire server to see if I can find where it could also be "extra" bound, and nothing is found.

Screenshot: http://prntscr.com/bpnxki

EDIT: I have killed the varnish process for now, then restarted nginx, and when I netstat -tlnp I can see that it is binding to both ports 80 and 8080. I need this on port 8080 only: http://prntscr.com/bpo2yl

How can I prevent nginx from binding to port 80 period?

Kevin
  • 354
  • 1
  • 4
  • 23

1 Answers1

0

You have to edit the configurations for your nginx sites under /etc/nginx/sites-enabled and change the listen directives to a different port. Or remove the sites from the enabled list. Once done and you run sudo service nginx restart, then nginx should no longer bind to those ports.

(The only other reason nginx might bind to ports and disobey the standard config is if it's not a standard setup and is, for example, an nginx that is bundled up with some other software and not following the standard configuration locations as a result.)

Thomas Ward
  • 78,878