So yesterday I was playing around with our server.
On it we have a docker-compose process running 6 or so containers, one of them being Nginx. Before I played around with it yesterday it was serving files just fine.
What I did
I noticed on DO, that I could upgrade my metrics by running
curl -sSL https://agent.digitalocean.com/install.sh | sh. How cool right??
Well after I did that, weird stuff started happening. I cant be sure that it is causation, but it certainly is correlation.
What I tried
I have my DO droplet, and i run
docker-compose up -d and I get a :
ERROR: for root_nginx_1 Cannot start service nginx: driver failed programming external connectivity on endpoint root_nginx_1: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
Ok, thats weird...
It was working before and now it wont even start up?
ps aux -P | grep nginx to see what going on and get:
root 1514 0.0 0.1 124972 1388 ? Ss 12:57 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; www-data 1517 0.0 0.2 125332 2960 ? S 12:57 0:00 nginx: worker process root 5716 0.0 0.0 12944 940 pts/1 S+ 13:16 0:00 grep --color=auto nginx
Hmm, why are there these other nginx processes?
ok, I then run
pkill nginx to get rid of them and then again
docker-compose up -d and everything startsup fine and dandy, no errors.
However, now when I go to my
example.com site, I get no response.
Thinking it might be a config issue, I run
docker logs root_nginx_1 and there is NOTHING. There should be at least some headers or requests being logged.
Then in a desperate final attempt I run
sudo shutdown -r now and start the whole process over.
Same result with the nginx process running on the server.
- Is it normal for this nginx process to be running on the server on startup?
- How can I get my nginx container to listen on port 80 without a conflict?