hardillb / nginx-proxy-avahi-helper

A container to generate matching mDNS CNAMEs for the virtual hosts used by jwilder/nginx-proxy
https://www.hardill.me.uk/wordpress/2020/09/22/nginx-proxy-avahi-helper/
Apache License 2.0
15 stars 2 forks source link

502 Bad Gateway #2

Closed nickv2002 closed 3 years ago

nickv2002 commented 3 years ago

Hey, I've been using your helper for a few weeks and it was working great. Thanks for sharing it!

Recently however, editing or creating new *.local URLs stopped working and I get the following message when I try to access them:

502 Bad Gateway nginx/1.19.3

My older *.local URLs that I haven't edited recently remain working though.

Here's the tail of the log file from nginx-proxy-avahi-helper (sha256:b73c58fa9edc43df63b934a22889344a204069eb9d449b6aa043fa9c396c1b50, Created | 2020-10-06 02:01:14 )

today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Received event die for container ee889cabfcd8 today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Received event stop for container ee889cabfcd8 today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Generated 'cnames' from 11 containers today at 10:39 AM cname.1 | INFO: Exiting on SIGTERM... today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Contents of cnames did not change. Skipping notification '/usr/src/app/restart.sh' today at 10:39 AM forego | starting cname.1 on port 5200 today at 10:39 AM forego | sending SIGTERM to cname.1 today at 10:39 AM forego | sending SIGTERM to dockergen.1 today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Received signal: terminated today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Received signal: terminated today at 10:39 AM today at 10:39 AM forego | starting dockergen.1 on port 5000 today at 10:39 AM forego | starting cname.1 on port 5100 today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Contents of cnames did not change. Skipping notification '/usr/src/app/restart.sh' today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Watching docker events today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Contents of cnames did not change. Skipping notification '/usr/src/app/restart.sh' today at 10:39 AM cname.1 | INFO: All CNAMEs published today at 10:40 AM dockergen.1 | 2020/11/03 18:40:29 Received event start for container 5fbff26b8d87 today at 10:40 AM dockergen.1 | 2020/11/03 18:40:29 Generated 'cnames' from 12 containers today at 10:40 AM cname.1 | INFO: Exiting on SIGTERM... today at 10:40 AM forego | starting cname.1 on port 5200 today at 10:40 AM forego | sending SIGTERM to dockergen.1 today at 10:40 AM forego | sending SIGTERM to cname.1 today at 10:40 AM dockergen.1 | 2020/11/03 18:40:30 Received signal: terminated today at 10:40 AM today at 10:40 AM forego | starting dockergen.1 on port 5000 today at 10:40 AM forego | starting cname.1 on port 5100 today at 10:40 AM dockergen.1 | 2020/11/03 18:40:31 Contents of cnames did not change. Skipping notification '/usr/src/app/restart.sh' today at 10:40 AM dockergen.1 | 2020/11/03 18:40:31 Watching docker events today at 10:40 AM dockergen.1 | 2020/11/03 18:40:31 Contents of cnames did not change. Skipping notification '/usr/src/app/restart.sh' today at 10:40 AM cname.1 | INFO: All CNAMEs published

And here's the tail of the log from nginx-proxy for the same time period (sha256:5e6f392e99e5454851caa8a3dbb021560a32375edff772b64f862c4d7831d038 Created 2020-10-30 09:46:00):

today at 10:38 AM Custom dhparam.pem file found, generation skipped today at 10:38 AM forego | starting dockergen.1 on port 5000 today at 10:38 AM forego | starting nginx.1 on port 5100 today at 10:38 AM dockergen.1 | 2020/11/03 18:38:28 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload' today at 10:38 AM dockergen.1 | 2020/11/03 18:38:28 Watching docker events today at 10:38 AM dockergen.1 | 2020/11/03 18:38:28 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload' today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Received event die for container ee889cabfcd8 today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Received event stop for container ee889cabfcd8 today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Generated '/etc/nginx/conf.d/default.conf' from 11 containers today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Running 'nginx -s reload' today at 10:39 AM dockergen.1 | 2020/11/03 18:39:26 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload' today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Received event die for container 2dadf9c97119 today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload' today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Received event start for container 2dadf9c97119 today at 10:39 AM dockergen.1 | 2020/11/03 18:39:27 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload' today at 10:40 AM dockergen.1 | 2020/11/03 18:40:29 Received event start for container 5fbff26b8d87 today at 10:40 AM dockergen.1 | 2020/11/03 18:40:29 Generated '/etc/nginx/conf.d/default.conf' from 12 containers today at 10:40 AM dockergen.1 | 2020/11/03 18:40:30 Received event die for container 2dadf9c97119 today at 10:40 AM dockergen.1 | 2020/11/03 18:40:30 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload' today at 10:40 AM dockergen.1 | 2020/11/03 18:40:31 Received event start for container 2dadf9c97119 today at 10:40 AM dockergen.1 | 2020/11/03 18:40:31 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload' today at 10:40 AM nginx.1 | 2020/11/03 18:40:41 [error] 42#42: 1 no live upstreams while connecting to upstream, client: 172.18.0.1, server: twldev.local, request: "GET / HTTP/1.1", upstream: "http://twldev.local/", host: "twldev.local" today at 10:40 AM nginx.1 | twldev.local 172.18.0.1 - - [03/Nov/2020:18:40:41 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15" today at 10:40 AM nginx.1 | 2020/11/03 18:40:41 [error] 42#42: 2 no live upstreams while connecting to upstream, client: 172.18.0.1, server: twldev.local, request: "GET /favicon.ico HTTP/1.1", upstream: "http://twldev.local/favicon.ico", host: "twldev.local", referrer: "http://twldev.local/" today at 10:40 AM nginx.1 | twldev.local 172.18.0.1 - - [03/Nov/2020:18:40:41 +0000] "GET /favicon.ico HTTP/1.1" 502 157 "http://twldev.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15"

Any idea what is going on and how I could fix things? Thanks again!

hardillb commented 3 years ago

That's going to be a problem with the nginx-plugin not the avahi integration.

It sounds like the mDNS cname has been setup (so this project is working fine) but nginx can't connect to the container.

nickv2002 commented 3 years ago

Thanks for your comments.