<div dir="ltr">Without showing your nginx config it's unlikely that anyone will be able to troubleshoot. Likely there is a stray listen directive that's causing this.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 31, 2016 at 9:29 PM, plutocrat <span dir="ltr"><<a href="mailto:nginx-forum@forum.nginx.org" target="_blank">nginx-forum@forum.nginx.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm having an odd problem here. I'm trying to set up nginx with a varnish<br>
proxy in front of it. The box is Ubuntu 15.10, nginx 1.9.3, varnish 4.0.3.<br>
<br>
For testing I set up varnish on port 8080, and nginx was running on port 80<br>
and 443. I shut down both, edit the config files so that varnish is<br>
listening on port 80 and forwarding to the nginx backend on 8080. I do a<br>
search and replace on all the listen directives in /etc/nginx/sites-enabled<br>
to change listen 80 to listen 8080.<br>
<br>
When I restart nginx, it comes up listening on port 8080 and 443 as<br>
expected, but ALSO on port 80. This means varnish is unable to start up as<br>
the port is already bound.<br>
<br>
tcp 0 0 <a href="http://0.0.0.0:80" rel="noreferrer" target="_blank">0.0.0.0:80</a> 0.0.0.0:* LISTEN<br>
17514/nginx -g daem<br>
tcp 0 0 <a href="http://0.0.0.0:8080" rel="noreferrer" target="_blank">0.0.0.0:8080</a> 0.0.0.0:* LISTEN<br>
17514/nginx -g daem<br>
tcp 0 0 <a href="http://0.0.0.0:443" rel="noreferrer" target="_blank">0.0.0.0:443</a> 0.0.0.0:* LISTEN<br>
17514/nginx -g daem<br>
<br>
I've checked through the nginx conf files many times. There are no other<br>
listen 80 directives. I've also tried putting a server block in the main<br>
nginx.conf with listen 8080 in it, but that doesn't help.<br>
<br>
I think the problem may be that this system is confused between systemd and<br>
init.d. I was having trouble with varnish in this respect. However I've<br>
checked all the systemd files and none of them mention a port, and the<br>
/etc/init.d/nginx file doesn't either.<br>
<br>
Why is nginx using port 80? And how to stop it! Any pointers gratefully<br>
received.<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,265791,265791#msg-265791" rel="noreferrer" target="_blank">https://forum.nginx.org/read.php?2,265791,265791#msg-265791</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>