2

I have setup Varnish to run on port 80 which seems to work fine.

COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
varnishd 8005 nobody    7u  IPv4  14055      0t0  TCP *:http (LISTEN)
varnishd 8005 nobody    8u  IPv6  14056      0t0  TCP *:http (LISTEN)

Under available sites in /etc/nginx I have the file default with:

server {
  listen 8080;

....

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Why is it still looking for port 80?

1
  • Chances are that one of the referenced files tries to use the default port. At a guess (since it has happened to me all to often), I'd start with /etc/nginx/conf.d/default.conf (which gets included by default from nginx.conf's include /etc/nginx/conf.d/*.conf; statement)
    – cyberx86
    Nov 12, 2012 at 10:42

2 Answers 2

2

You should add

listen 8080 default;

And make sure that in other configuration files or virtualhosts there is no other default port 80.

1
  • I noticed I had another config file in the directory that had port 80, thanks
    – Stofke
    Nov 12, 2012 at 10:58
0

You have a directive somewhere that is telling nginx to bind to port 80 find it and make the necessary change

cd /etc/nginx
grep -rw 80 *

Should get you looking in the right place.

1
  • I couldn't find it at first grepping it but when B14D3 send in his anwser it was clear to me where the error was. Sorry but I can only select one good answer.
    – Stofke
    Nov 12, 2012 at 11:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .