Welcome! Log In Create A New Profile

Advanced

Nginx with Varnish as a proxy. Phantom Port 80

April 01, 2016 12:29AM
Hi,

I'm having an odd problem here. I'm trying to set up nginx with a varnish proxy in front of it. The box is Ubuntu 15.10, nginx 1.9.3, varnish 4.0.3.

For testing I set up varnish on port 8080, and nginx was running on port 80 and 443. I shut down both, edit the config files so that varnish is listening on port 80 and forwarding to the nginx backend on 8080. I do a search and replace on all the listen directives in /etc/nginx/sites-enabled to change listen 80 to listen 8080.

When I restart nginx, it comes up listening on port 8080 and 443 as expected, but ALSO on port 80. This means varnish is unable to start up as the port is already bound.

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 17514/nginx -g daem
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 17514/nginx -g daem
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 17514/nginx -g daem

I've checked through the nginx conf files many times. There are no other listen 80 directives. I've also tried putting a server block in the main nginx.conf with listen 8080 in it, but that doesn't help.

I think the problem may be that this system is confused between systemd and init.d. I was having trouble with varnish in this respect. However I've checked all the systemd files and none of them mention a port, and the /etc/init.d/nginx file doesn't either.

Why is nginx using port 80? And how to stop it! Any pointers gratefully received.
Subject Author Posted

Nginx with Varnish as a proxy. Phantom Port 80

plutocrat April 01, 2016 12:29AM

Re: Nginx with Varnish as a proxy. Phantom Port 80

Robert Paprocki April 01, 2016 12:34AM

Re: Nginx with Varnish as a proxy. Phantom Port 80

plutocrat April 01, 2016 12:42AM

Re: Nginx with Varnish as a proxy. Phantom Port 80

Robert Paprocki April 01, 2016 12:48AM

Re: Nginx with Varnish as a proxy. Phantom Port 80

plutocrat April 01, 2016 01:38AM

Re: Nginx with Varnish as a proxy. Phantom Port 80

plutocrat April 01, 2016 01:41AM

Re: Nginx with Varnish as a proxy. Phantom Port 80

Francis Daly April 01, 2016 03:14AM

Re: Nginx with Varnish as a proxy. Phantom Port 80

Francis Daly April 01, 2016 03:18AM

Re: Nginx with Varnish as a proxy. Phantom Port 80

plutocrat April 01, 2016 06:33AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready