[GH-ISSUE #640] (111: Connection refused) on Proxy host with docker container as destination #541

Closed
opened 2026-02-26 06:33:19 +03:00 by kerem · 2 comments
Owner

Originally created by @kutoman on GitHub (Oct 8, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/640

What is troubling you?

connections by a reverse proxy setting fail to a docker container of the same docker network.
I just can't figure out why the connections are refused. I feel like the fix is simple.

from the error log:

2020/10/08 18:03:02 [error] 269#269: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: ***.duckdns.org, request: "GET / HTTP/1.1", upstream: "http://172.19.0.3:80/", host: "***.duckdns.org"
2020/10/08 18:03:03 [error] 269#269: *8 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: ***.duckdns.org, request: "GET / HTTP/2.0", upstream: "http://172.19.0.3:80/", host: "***.duckdns.org"

docker-compose.yml:

version: "3.7"

services: 
  jetty:
    container_name: jetty
    image: jetty:9
    ports:
      - '80'
    volumes:
      - './jetty/webapps:/var/lib/jetty/webapps'
  # for reverse proxy
  nginx-pm:
    container_name: nginx-pm
    image: jc21/nginx-proxy-manager:2
    restart: always
    ports:
    - 80:80 # Public HTTP Port
    - 443:443 # Public HTTPS Port:
    - 81:81 # Admin Web Port:
    volumes:
    - ./nginx-proxy-manager/config.json:/app/config/production.json
    - ./nginx-proxy-manager/data:/data
    - ./nginx-proxy-manager/letsencrypt:/etc/letsencrypt

proxy host setting:

grafik

when trying to access: (on both http and https)

grafik

Originally created by @kutoman on GitHub (Oct 8, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/640 **What is troubling you?** connections by a reverse proxy setting fail to a docker container of the same docker network. I just can't figure out why the connections are refused. I feel like the fix is simple. **from the error log:** ``` 2020/10/08 18:03:02 [error] 269#269: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: ***.duckdns.org, request: "GET / HTTP/1.1", upstream: "http://172.19.0.3:80/", host: "***.duckdns.org" 2020/10/08 18:03:03 [error] 269#269: *8 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: ***.duckdns.org, request: "GET / HTTP/2.0", upstream: "http://172.19.0.3:80/", host: "***.duckdns.org" ``` **docker-compose.yml:** ``` version: "3.7" services: jetty: container_name: jetty image: jetty:9 ports: - '80' volumes: - './jetty/webapps:/var/lib/jetty/webapps' # for reverse proxy nginx-pm: container_name: nginx-pm image: jc21/nginx-proxy-manager:2 restart: always ports: - 80:80 # Public HTTP Port - 443:443 # Public HTTPS Port: - 81:81 # Admin Web Port: volumes: - ./nginx-proxy-manager/config.json:/app/config/production.json - ./nginx-proxy-manager/data:/data - ./nginx-proxy-manager/letsencrypt:/etc/letsencrypt ``` **proxy host setting:** ![grafik](https://user-images.githubusercontent.com/5825645/95497864-48c32580-09a3-11eb-95d0-a7d34cd1d2c6.png) **when trying to access:** (on both http and https) ![grafik](https://user-images.githubusercontent.com/5825645/95498147-af484380-09a3-11eb-8612-83151e52a811.png)
kerem 2026-02-26 06:33:19 +03:00
Author
Owner

@kutoman commented on GitHub (Oct 8, 2020):

there was an error when I submitted this issue.. there is a duplicate here: #641

<!-- gh-comment-id:705744798 --> @kutoman commented on GitHub (Oct 8, 2020): there was an error when I submitted this issue.. there is a duplicate here: #641
Author
Owner

@kutoman commented on GitHub (Oct 10, 2020):

@admin you can delete this one (issue)

<!-- gh-comment-id:706545669 --> @kutoman commented on GitHub (Oct 10, 2020): @admin you can delete this one (issue)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#541
No description provided.