-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad Gateway --net=host #1537
Comments
I have now tried this with another container - the exact same issue. docker run -d --name ReverseProxy -p 80:80 -p 443:443 --net=host -v //etc/DockerStorage/ReverseProxy:/etc/nginx/certs -v /var/run/docker.sock:/tmp/docker.sock:ro --restart=unless-stopped jwilder/nginx-proxy docker run -d --name HomeAssistant -e VIRTUAL_HOST=DOMAIN.COM -e VIRTUAL_PORT=8123 --net=host --expose=8123 -v "//etc/DockerStorage/HomeAssistant:/config" -v /etc/localtime:/etc/localtime:ro --restart=unless-stopped homeassistant/home-assistant:stable |
Anyone ? |
Same. Hosts are marked as being offline unless in bridge mode. |
I'm not a docker expert, but I don't think putting both containers on the host network works, since the expose option probably doesn't work on the host (same as publishing ports). |
In this case, maybe you should try port forwarding. |
I believe home assistant may need --net host to function properly and be able to contact/detect all accessories |
To anyone affected by this, could you:
|
Have the same problem, trying to run Pi-hole together with other services. Found the tip to look at the config before stumbling over this issue. It looks to my uninformed eyes as if nginx-proxy gets confused because it expects to be able to ask docker for an internal IP, but running the containers in host net mode there is none and nginx is unable to create an entry. So nginx-proxy should probably be changed to detect running with
|
Found the relevant lines in the template: Lines 125 to 130 in c4ad18f
|
Your issue might be similar to #2144 |
Detect if a target container is running host networking, and if so, use the IP address of the bridge net gateway.
Just submitted a PR that implements this. It detects containers running host networking and uses the gateway of the proxy bridge network as the upstream IP. This means it'll work for any target containers that listen on either this specific host interface, or more commonly listening on all host interfaces. |
Detect if a target container is running host networking, and if so, use the IP address of the first bridge net gateway.
Support containers running --net=host (#1537)
I am trying to use the reverseproxy in "-net host" mode but it seems like I keep getting a "Bad gateway".
Is this a bug, or what am I doing wrong?
I first reported it at homebridge, but they suggested it was a ReverseProxy issue.
homebridge/homebridge#2731
The text was updated successfully, but these errors were encountered: