[GH-ISSUE #532] Bad Gateway app login - serious issue #451

Closed
opened 2026-02-26 06:32:54 +03:00 by kerem · 13 comments
Owner

Originally created by @mohdlatif on GitHub (Jul 29, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/532

Hi there, I have spent countless hours trying to configure nginxproxymanager on my server.
My server details:
OS: Centos 7
Nginx
Docker and docker compose latest version.
I am using https://vpssim.com/.

I created a subdomain and in the public_html folder I created both files config.json and docker-compose.yml

The first issue i faced is port 443 is used to generate certificate and 80 is being used by Nginx, so i have to find a way to change the ports.

So I did a little configuration by changing the port like this

  **- '8080:80'
  - '81:81'
  - '8443:443'**

Great, it works and the port 3306 is running
image

The issue after this is whenever i try to login it says Bad Gateway

image

I have read many threads about this issue,

Here is what I have done

Change "host": "db" to "host": "my server IP", - Does not work
Change "host": "db" to "host": "subdomain.mywebsite.com", - Does not work
Turned off Nginx via systemctl stop nginx.service and run on the defaults ports (port 443 and 80)- Does not work

Here is log file

2020/07/29 11:21:24 [error] 245#245: *1973 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:30 [error] 245#245: *1975 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:35 [error] 245#245: *1977 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:40 [error] 245#245: *1979 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:45 [error] 245#245: *1981 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:49 [error] 245#245: *1984 connect() failed (111: Connection refused) while connecting to upstream, client: 202.186.36.196, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "nprxy.mywebsite.com:81", referrer: "http://nprxy.mywebsite.com:81/" 2020/07/29 11:21:51 [error] 245#245: *1986 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:56 [error] 245#245: *1988 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:59 [error] 245#245: *1984 connect() failed (111: Connection refused) while connecting to upstream, client: 202.186.36.196, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "nprxy.mywebsite.com:81", referrer: "http://nprxy.mywebsite.com:81/login" 2020/07/29 11:22:01 [error] 245#245: *1991 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81"

How i can solve this issue.

Thanks.

Originally created by @mohdlatif on GitHub (Jul 29, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/532 Hi there, I have spent countless hours trying to configure nginxproxymanager on my server. My server details: OS: Centos 7 Nginx Docker and docker compose latest version. I am using https://vpssim.com/. I created a **subdomain** and in the public_html folder I created both files **config.json** and **docker-compose.yml** The first issue i faced is port 443 is used to generate certificate and 80 is being used by Nginx, so i have to find a way to change the ports. So I did a little configuration by changing the port like this **- '8080:80' - '81:81' - '8443:443'** Great, it works and the port 3306 is running ![image](https://user-images.githubusercontent.com/56746772/88791331-20ad8e00-d1cc-11ea-8e95-02b6f2fe40a7.png) The issue after this is whenever i try to login it says **Bad Gateway** ![image](https://user-images.githubusercontent.com/56746772/88792337-a7af3600-d1cd-11ea-8879-939e5dc2eeda.png) I have read many threads about this issue, Here is what I have done Change **"host": "db"** to "host": "my server IP", - Does not work Change **"host": "db"** to "host": "subdomain.mywebsite.com", - Does not work Turned off **Nginx** via systemctl stop nginx.service and run on the defaults ports (port 443 and 80)- Does not work Here is log file `2020/07/29 11:21:24 [error] 245#245: *1973 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:30 [error] 245#245: *1975 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:35 [error] 245#245: *1977 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:40 [error] 245#245: *1979 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:45 [error] 245#245: *1981 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:49 [error] 245#245: *1984 connect() failed (111: Connection refused) while connecting to upstream, client: 202.186.36.196, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "nprxy.mywebsite.com:81", referrer: "http://nprxy.mywebsite.com:81/" 2020/07/29 11:21:51 [error] 245#245: *1986 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:56 [error] 245#245: *1988 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:59 [error] 245#245: *1984 connect() failed (111: Connection refused) while connecting to upstream, client: 202.186.36.196, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "nprxy.mywebsite.com:81", referrer: "http://nprxy.mywebsite.com:81/login" 2020/07/29 11:22:01 [error] 245#245: *1991 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" ` How i can solve this issue. Thanks.
kerem 2026-02-26 06:32:54 +03:00
Author
Owner

@godsom commented on GitHub (Aug 21, 2020):

I got same issue after first run docker-compose from full guide.
from from my point database cannot start
I fixed by change docker-compose.yml from
db:
image: jc21/mariadb-aria:10.4
to
db:
image: mariadb:latest

<!-- gh-comment-id:678198772 --> @godsom commented on GitHub (Aug 21, 2020): I got same issue after first run docker-compose from full guide. from from my point database cannot start I fixed by change docker-compose.yml from db: image: jc21/mariadb-aria:10.4 to db: image: mariadb:latest
Author
Owner

@iga566 commented on GitHub (Sep 14, 2020):

Hi there, I have spent countless hours trying to configure nginxproxymanager on my server.
My server details:
OS: Centos 7
Nginx
Docker and docker compose latest version.
I am using https://vpssim.com/.

I created a subdomain and in the public_html folder I created both files config.json and docker-compose.yml

The first issue i faced is port 443 is used to generate certificate and 80 is being used by Nginx, so i have to find a way to change the ports.

So I did a little configuration by changing the port like this

  **- '8080:80'
  - '81:81'
  - '8443:443'**

Great, it works and the port 3306 is running
image

The issue after this is whenever i try to login it says Bad Gateway

image

I have read many threads about this issue,

Here is what I have done

Change "host": "db" to "host": "my server IP", - Does not work
Change "host": "db" to "host": "subdomain.mywebsite.com", - Does not work
Turned off Nginx via systemctl stop nginx.service and run on the defaults ports (port 443 and 80)- Does not work

Here is log file

2020/07/29 11:21:24 [error] 245#245: *1973 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:30 [error] 245#245: *1975 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:35 [error] 245#245: *1977 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:40 [error] 245#245: *1979 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:45 [error] 245#245: *1981 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:49 [error] 245#245: *1984 connect() failed (111: Connection refused) while connecting to upstream, client: 202.186.36.196, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "nprxy.mywebsite.com:81", referrer: "http://nprxy.mywebsite.com:81/" 2020/07/29 11:21:51 [error] 245#245: *1986 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:56 [error] 245#245: *1988 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:59 [error] 245#245: *1984 connect() failed (111: Connection refused) while connecting to upstream, client: 202.186.36.196, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "nprxy.mywebsite.com:81", referrer: "http://nprxy.mywebsite.com:81/login" 2020/07/29 11:22:01 [error] 245#245: *1991 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81"

How i can solve this issue.

Thanks.

i have the same issue

<!-- gh-comment-id:692328893 --> @iga566 commented on GitHub (Sep 14, 2020): > Hi there, I have spent countless hours trying to configure nginxproxymanager on my server. > My server details: > OS: Centos 7 > Nginx > Docker and docker compose latest version. > I am using https://vpssim.com/. > > I created a **subdomain** and in the public_html folder I created both files **config.json** and **docker-compose.yml** > > The first issue i faced is port 443 is used to generate certificate and 80 is being used by Nginx, so i have to find a way to change the ports. > > So I did a little configuration by changing the port like this > > ``` > **- '8080:80' > - '81:81' > - '8443:443'** > ``` > > Great, it works and the port 3306 is running > ![image](https://user-images.githubusercontent.com/56746772/88791331-20ad8e00-d1cc-11ea-8e95-02b6f2fe40a7.png) > > The issue after this is whenever i try to login it says **Bad Gateway** > > ![image](https://user-images.githubusercontent.com/56746772/88792337-a7af3600-d1cd-11ea-8879-939e5dc2eeda.png) > > I have read many threads about this issue, > > Here is what I have done > > Change **"host": "db"** to "host": "my server IP", - Does not work > Change **"host": "db"** to "host": "subdomain.mywebsite.com", - Does not work > Turned off **Nginx** via systemctl stop nginx.service and run on the defaults ports (port 443 and 80)- Does not work > > Here is log file > > `2020/07/29 11:21:24 [error] 245#245: *1973 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:30 [error] 245#245: *1975 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:35 [error] 245#245: *1977 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:40 [error] 245#245: *1979 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:45 [error] 245#245: *1981 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:49 [error] 245#245: *1984 connect() failed (111: Connection refused) while connecting to upstream, client: 202.186.36.196, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "nprxy.mywebsite.com:81", referrer: "http://nprxy.mywebsite.com:81/" 2020/07/29 11:21:51 [error] 245#245: *1986 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:56 [error] 245#245: *1988 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2020/07/29 11:21:59 [error] 245#245: *1984 connect() failed (111: Connection refused) while connecting to upstream, client: 202.186.36.196, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "nprxy.mywebsite.com:81", referrer: "http://nprxy.mywebsite.com:81/login" 2020/07/29 11:22:01 [error] 245#245: *1991 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" ` > > How i can solve this issue. > > Thanks. i have the same issue
Author
Owner

@codeagencybe commented on GitHub (Sep 19, 2020):

I got it working!

db_1 | 2020-09-19 12:31:16 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!

All I did was delete the .ibdata1 file that shows 0kb
And then re-deploy the whole setup. Now it generates a new clean .ibdata file that is around 12Mb size

<!-- gh-comment-id:695208316 --> @codeagencybe commented on GitHub (Sep 19, 2020): I got it working! `db_1 | 2020-09-19 12:31:16 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages! ` All I did was delete the .ibdata1 file that shows 0kb And then re-deploy the whole setup. Now it generates a new clean .ibdata file that is around 12Mb size
Author
Owner

@pierow2k commented on GitHub (Sep 30, 2020):

I fixed by change docker-compose.yml from
db:
image: jc21/mariadb-aria:10.4
to
db:
image: mariadb:latest

Fixed the issue for me as well. Many thanks @godsom !

<!-- gh-comment-id:701136636 --> @pierow2k commented on GitHub (Sep 30, 2020): > I fixed by change docker-compose.yml from > db: > image: jc21/mariadb-aria:10.4 > to > db: > image: mariadb:latest Fixed the issue for me as well. Many thanks @godsom !
Author
Owner

@wimmme commented on GitHub (Dec 3, 2020):

For me on a RPI 3 running Hypriot

db:
image: mariadb:latest

does not work, but this does:

db:
image: yobasystems/alpine-mariadb:armhf
<!-- gh-comment-id:737963129 --> @wimmme commented on GitHub (Dec 3, 2020): For me on a RPI 3 running Hypriot ``` db: image: mariadb:latest ``` does not work, but this does: ``` db: image: yobasystems/alpine-mariadb:armhf ```
Author
Owner

@anselal commented on GitHub (Jan 4, 2021):

@wimmme did not work for me on my rpi2

<!-- gh-comment-id:753781611 --> @anselal commented on GitHub (Jan 4, 2021): @wimmme did not work for me on my rpi2
Author
Owner

@mcarter960 commented on GitHub (Jan 23, 2021):

This worked for me also...running on a pi4. Thank you wimmme

creating config.json
and
editing docker-compose.yml
db:
image: yobasystems/alpine-mariadb:armhf

<!-- gh-comment-id:766180587 --> @mcarter960 commented on GitHub (Jan 23, 2021): This worked for me also...running on a pi4. Thank you **wimmme** creating config.json _and_ editing docker-compose.yml db: image: yobasystems/alpine-mariadb:armhf
Author
Owner

@anselal commented on GitHub (Jan 25, 2021):

This works on my RPi2

version: "2"
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      # Public HTTP Port:
      - '80:80'
      # Public HTTPS Port:
      - '443:443'
      # Admin Web Port:
      - '81:81'
    environment:
      # These are the settings to access your db
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"
      DISABLE_IPV6: 'true'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db
  db:
    image: yobasystems/alpine-mariadb:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./data/mysql:/var/lib/mysql

the trick besides changing the image for the DB is to use version: "2"

<!-- gh-comment-id:766543503 --> @anselal commented on GitHub (Jan 25, 2021): This works on my RPi2 ```sh version: "2" services: app: image: 'jc21/nginx-proxy-manager:latest' restart: always ports: # Public HTTP Port: - '80:80' # Public HTTPS Port: - '443:443' # Admin Web Port: - '81:81' environment: # These are the settings to access your db DB_MYSQL_HOST: "db" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: "npm" DB_MYSQL_NAME: "npm" DISABLE_IPV6: 'true' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt depends_on: - db db: image: yobasystems/alpine-mariadb:latest restart: always environment: MYSQL_ROOT_PASSWORD: 'npm' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' volumes: - ./data/mysql:/var/lib/mysql ``` the trick besides changing the image for the DB is to use `version: "2"`
Author
Owner

@cxdy commented on GitHub (Feb 17, 2021):

I'm running on Ubuntu 20.04 inside a virtual machine.

Docker version 20.10.3
docker-compose version 1.28.2

2021/02/17 01:36:08 [error] 261#261: *33 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81"
2021/02/17 01:36:13 [error] 261#261: *35 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81"
2021/02/17 01:36:17 [error] 261#261: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.4, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "10.0.0.7:81", referrer: "http://10.0.0.7:81/login"
2021/02/17 01:36:18 [error] 261#261: *38 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81"
2021/02/17 01:36:24 [error] 261#261: *40 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81"

Here is my config:

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      DB_MYSQL_HOST: "localhost"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "nginx"
      DB_MYSQL_PASSWORD: ""
      DB_MYSQL_NAME: "nginx"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
  db:
    image: 'mariadb:latest'
    environment:
      MYSQL_ROOT_PASSWORD: ''
      MYSQL_DATABASE: 'nginx'
      MYSQL_USER: 'nginx'
      MYSQL_PASSWORD: ''
    volumes:
      - ./data/mysql:/var/lib/mysql

Firewall:

Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
81                         ALLOW       Anywhere
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
3000                       ALLOW       Anywhere

download

Any ideas?

<!-- gh-comment-id:780236059 --> @cxdy commented on GitHub (Feb 17, 2021): I'm running on Ubuntu 20.04 inside a virtual machine. Docker version 20.10.3 docker-compose version 1.28.2 ``` 2021/02/17 01:36:08 [error] 261#261: *33 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2021/02/17 01:36:13 [error] 261#261: *35 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2021/02/17 01:36:17 [error] 261#261: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.4, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "10.0.0.7:81", referrer: "http://10.0.0.7:81/login" 2021/02/17 01:36:18 [error] 261#261: *38 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" 2021/02/17 01:36:24 [error] 261#261: *40 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "127.0.0.1:81" ``` Here is my config: ``` version: '3' services: app: image: 'jc21/nginx-proxy-manager:latest' ports: - '80:80' - '81:81' - '443:443' environment: DB_MYSQL_HOST: "localhost" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "nginx" DB_MYSQL_PASSWORD: "" DB_MYSQL_NAME: "nginx" volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt db: image: 'mariadb:latest' environment: MYSQL_ROOT_PASSWORD: '' MYSQL_DATABASE: 'nginx' MYSQL_USER: 'nginx' MYSQL_PASSWORD: '' volumes: - ./data/mysql:/var/lib/mysql ``` Firewall: ``` Status: active To Action From -- ------ ---- 22 ALLOW Anywhere 81 ALLOW Anywhere 80 ALLOW Anywhere 443 ALLOW Anywhere 3000 ALLOW Anywhere ``` ![download](https://user-images.githubusercontent.com/6620597/108144212-3bc3ea80-7097-11eb-9f3a-5b22206e08e3.png) Any ideas?
Author
Owner

@jc21 commented on GitHub (Feb 17, 2021):

First rule of docker debugging:

docker logs name_of_npm_container
<!-- gh-comment-id:780254481 --> @jc21 commented on GitHub (Feb 17, 2021): First rule of docker debugging: ```bash docker logs name_of_npm_container ```
Author
Owner

@cxdy commented on GitHub (Feb 17, 2021):

@jc21 I resolved it by changing my MYSQL IP in the docker-compose.yml to the IP of the docker container. All is well now, thanks!

<!-- gh-comment-id:780258402 --> @cxdy commented on GitHub (Feb 17, 2021): @jc21 I resolved it by changing my MYSQL IP in the docker-compose.yml to the IP of the docker container. All is well now, thanks!
Author
Owner

@jc21 commented on GitHub (Feb 17, 2021):

In your example you can also set the database host name to db since it's in the same docker-compose file

<!-- gh-comment-id:780261543 --> @jc21 commented on GitHub (Feb 17, 2021): In your example you can also set the database host name to `db` since it's in the same docker-compose file
Author
Owner

@MrEagle123 commented on GitHub (May 17, 2025):

  • When logging to NPM I have error:
    Bad gateway
  • In "docker logs CONTAINER_ID" error:
    Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/cloudflare/

I created file ./volume/resolv.conf with the following content:
nameserver 1.1.1.1

and add "./volume/resolv.conf" to "volumes" section in docker-compose.yml

services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./volumes/data:/data
      - ./volumes/letsencrypt:/etc/letsencrypt
      - ./volumes/resolv.conf:/etc/resolv.conf

And the problem is solved!

<!-- gh-comment-id:2888590988 --> @MrEagle123 commented on GitHub (May 17, 2025): - When logging to NPM I have error: `Bad gateway` - In "docker logs CONTAINER_ID" error: `Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/cloudflare/` I created file ./volume/resolv.conf with the following content: `nameserver 1.1.1.1` and add "./volume/resolv.conf" to "volumes" section in docker-compose.yml ``` services: app: image: 'jc21/nginx-proxy-manager:latest' restart: always ports: - '80:80' - '81:81' - '443:443' volumes: - ./volumes/data:/data - ./volumes/letsencrypt:/etc/letsencrypt - ./volumes/resolv.conf:/etc/resolv.conf ``` And the problem is solved!
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#451
No description provided.