[GH-ISSUE #4116] 502 bad gateway #2672

Open
opened 2026-02-26 07:36:25 +03:00 by kerem · 6 comments
Owner

Originally created by @not-chees on GitHub (Oct 27, 2024).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4116

Hi, I just setup nginx proxy manager and tried it out. However, when I try to reach a server, I get a 502 bad gateway. I have tried to use this with 3 servers, so it is not the server but nginx that has the problem.

Originally created by @not-chees on GitHub (Oct 27, 2024). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4116 Hi, I just setup nginx proxy manager and tried it out. However, when I try to reach a server, I get a 502 bad gateway. I have tried to use this with 3 servers, so it is not the server but nginx that has the problem.
Author
Owner

@GitXpresso commented on GitHub (Oct 27, 2024):

Google cloud shell don't accept port that has 2 characters in them example 127.0.1:21

<!-- gh-comment-id:2440031134 --> @GitXpresso commented on GitHub (Oct 27, 2024): Google cloud shell don't accept port that has 2 characters in them example 127.0.1:21
Author
Owner

@Xeravax commented on GitHub (Oct 28, 2024):

Where in the world does the 21 come from?

<!-- gh-comment-id:2441940591 --> @Xeravax commented on GitHub (Oct 28, 2024): Where in the world does the 21 come from?
Author
Owner

@GeneralUser-NonDev commented on GitHub (Nov 4, 2024):

following, Mine is doing this for my homeassistant path. all my others eventually worked, well, loaded (took loading them several times and messing with the different settings in the host config). its supposed to point to 192.168.107.173 on port 8123, but i just get "502 bad gateway - openresty".

<!-- gh-comment-id:2453658602 --> @GeneralUser-NonDev commented on GitHub (Nov 4, 2024): following, Mine is doing this for my homeassistant path. all my others eventually worked, well, loaded (took loading them several times and messing with the different settings in the host config). its supposed to point to 192.168.107.173 on port 8123, but i just get "502 bad gateway - openresty".
Author
Owner

@Xeravax commented on GitHub (Nov 4, 2024):

Ok so, a guess here. If you look at the logs, does letsencrypt have issues with installing?

<!-- gh-comment-id:2454586290 --> @Xeravax commented on GitHub (Nov 4, 2024): Ok so, a guess here. If you look at the logs, does letsencrypt have issues with installing?
Author
Owner

@GeneralUser-NonDev commented on GitHub (Nov 4, 2024):

with trying all kinds of combinations of network settings and such (Bridge, Host, Custom Docker Network, etc) My instillation on my Unraid got to the point that it will now not let me log in. It brings up the login page and I can enter my login but then it just stays on that page and Firefox diagnostics shows "ns error connection refused". The instillation on my Proxmox container I don't know how to look at logs, that one won't let me make certs at all, I just get "internal error".

any tricks to clean reinstall it and keep the current proxy hosts/logins?

unraid logs (what I'm able to access) is as follows:

text  error  warn  system  array  login  

[cont-init   ] 55-nginx-proxy-manager.sh: - /config/nginx/proxy_host/2.conf
[cont-init   ] 55-nginx-proxy-manager.sh: - /config/nginx/proxy_host/6.conf
[cont-init   ] 55-nginx-proxy-manager.sh: - /config/nginx/proxy_host/1.conf
[cont-init   ] 55-nginx-proxy-manager.sh: - /config/nginx/proxy_host/4.conf
[cont-init   ] 55-nginx-proxy-manager.sh: - /config/nginx/ip_ranges.conf
[cont-init   ] 55-nginx-proxy-manager.sh: - /config/nginx/resolvers.conf
[cont-init   ] 55-nginx-proxy-manager.sh: terminated successfully.
[cont-init   ] 85-take-config-ownership.sh: executing...
[cont-init   ] 85-take-config-ownership.sh: terminated successfully.
[cont-init   ] 89-info.sh: executing...
    ╭――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╮
    │                                                                      │
    │ Application:           Nginx Proxy Manager                           │
    │ Application Version:   2.11.3                                        │
    │ Docker Image Version:  24.07.1                                       │
    │ Docker Image Platform: linux/amd64                                   │
    │                                                                      │
    ╰――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╯
[cont-init   ] 89-info.sh: terminated successfully.
[cont-init   ] all container initialization scripts executed.
[init        ] giving control to process supervisor.
[supervisor  ] loading services...
[supervisor  ] loading service 'default'...
[supervisor  ] loading service 'app'...
[supervisor  ] loading service 'nginx'...
[supervisor  ] loading service 'logmonitor'...
[supervisor  ] service 'logmonitor' is disabled.
[supervisor  ] loading service 'logrotate'...
[supervisor  ] service 'logrotate' is disabled.
[supervisor  ] loading service 'cert_cleanup'...
[supervisor  ] all services loaded.
[supervisor  ] starting services...
[supervisor  ] starting service 'nginx'...
[supervisor  ] starting service 'app'...
[app         ] [11/4/2024] [8:35:30 AM] [Global   ] › ℹ  info      Using Sqlite: /data/database.sqlite
[supervisor  ] all services started.
[cert_cleanup] ----------------------------------------------------------
[cert_cleanup] Let's Encrypt certificates cleanup - 2024/11/04 08:35:31
[cert_cleanup] ----------------------------------------------------------
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-1/privkey3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-1/cert3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-1/chain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-1/fullchain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-2/privkey3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-2/cert3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-2/chain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-2/fullchain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-3/privkey3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-3/cert3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-3/chain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-3/fullchain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-5/privkey3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-5/cert3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-5/chain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-5/fullchain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-6/privkey3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-6/cert3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-6/chain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-6/fullchain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-7/privkey3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-7/cert3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-7/chain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-7/fullchain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-8/privkey3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-8/cert3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-8/chain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-8/fullchain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-9/privkey3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-9/cert3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-9/chain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-9/fullchain3.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-14/cert1.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-14/privkey1.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-14/chain1.pem.
[cert_cleanup] Keeping /etc/letsencrypt/archive/npm-14/fullchain1.pem.
[cert_cleanup] 36 file(s) kept.
[cert_cleanup] 0 file(s) deleted.
[app         ] [11/4/2024] [8:35:31 AM] [Migrate  ] › ℹ  info      Current database version: none
[app         ] [11/4/2024] [8:35:31 AM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[app         ] [11/4/2024] [8:35:31 AM] [Global   ] › ⬤  debug     CMD: logrotate -s /config/logrotate.status /etc/logrotate.d/nginx-proxy-manager
[app         ] [11/4/2024] [8:35:32 AM] [Setup    ] › ℹ  info      Logrotate completed.
[app         ] [11/4/2024] [8:35:32 AM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[app         ] [11/4/2024] [8:35:32 AM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[app         ] [11/4/2024] [8:35:36 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[app         ] [11/4/2024] [8:35:40 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[app         ] [11/4/2024] [8:35:44 AM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[app         ] [11/4/2024] [8:35:44 AM] [SSL      ] › ℹ  info      Renewing SSL certs expiring within 30 days ...
[app         ] [11/4/2024] [8:35:44 AM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[app         ] [11/4/2024] [8:35:44 AM] [Global   ] › ℹ  info      Backend PID 435 listening on port 3000 ...
[app         ] [11/4/2024] [8:35:44 AM] [SSL      ] › ℹ  info      Completed SSL cert renew process

NGINX

<!-- gh-comment-id:2454778298 --> @GeneralUser-NonDev commented on GitHub (Nov 4, 2024): with trying all kinds of combinations of network settings and such (Bridge, Host, Custom Docker Network, etc) My instillation on my Unraid got to the point that it will now not let me log in. It brings up the login page and I can enter my login but then it just stays on that page and Firefox diagnostics shows "ns error connection refused". The instillation on my Proxmox container I don't know how to look at logs, that one won't let me make certs at all, I just get "internal error". any tricks to clean reinstall it and keep the current proxy hosts/logins? unraid logs (what I'm able to access) is as follows: ``` text error warn system array login [cont-init ] 55-nginx-proxy-manager.sh: - /config/nginx/proxy_host/2.conf [cont-init ] 55-nginx-proxy-manager.sh: - /config/nginx/proxy_host/6.conf [cont-init ] 55-nginx-proxy-manager.sh: - /config/nginx/proxy_host/1.conf [cont-init ] 55-nginx-proxy-manager.sh: - /config/nginx/proxy_host/4.conf [cont-init ] 55-nginx-proxy-manager.sh: - /config/nginx/ip_ranges.conf [cont-init ] 55-nginx-proxy-manager.sh: - /config/nginx/resolvers.conf [cont-init ] 55-nginx-proxy-manager.sh: terminated successfully. [cont-init ] 85-take-config-ownership.sh: executing... [cont-init ] 85-take-config-ownership.sh: terminated successfully. [cont-init ] 89-info.sh: executing... ╭――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╮ │ │ │ Application: Nginx Proxy Manager │ │ Application Version: 2.11.3 │ │ Docker Image Version: 24.07.1 │ │ Docker Image Platform: linux/amd64 │ │ │ ╰――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╯ [cont-init ] 89-info.sh: terminated successfully. [cont-init ] all container initialization scripts executed. [init ] giving control to process supervisor. [supervisor ] loading services... [supervisor ] loading service 'default'... [supervisor ] loading service 'app'... [supervisor ] loading service 'nginx'... [supervisor ] loading service 'logmonitor'... [supervisor ] service 'logmonitor' is disabled. [supervisor ] loading service 'logrotate'... [supervisor ] service 'logrotate' is disabled. [supervisor ] loading service 'cert_cleanup'... [supervisor ] all services loaded. [supervisor ] starting services... [supervisor ] starting service 'nginx'... [supervisor ] starting service 'app'... [app ] [11/4/2024] [8:35:30 AM] [Global ] › ℹ info Using Sqlite: /data/database.sqlite [supervisor ] all services started. [cert_cleanup] ---------------------------------------------------------- [cert_cleanup] Let's Encrypt certificates cleanup - 2024/11/04 08:35:31 [cert_cleanup] ---------------------------------------------------------- [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-1/privkey3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-1/cert3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-1/chain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-1/fullchain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-2/privkey3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-2/cert3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-2/chain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-2/fullchain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-3/privkey3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-3/cert3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-3/chain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-3/fullchain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-5/privkey3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-5/cert3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-5/chain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-5/fullchain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-6/privkey3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-6/cert3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-6/chain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-6/fullchain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-7/privkey3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-7/cert3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-7/chain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-7/fullchain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-8/privkey3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-8/cert3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-8/chain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-8/fullchain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-9/privkey3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-9/cert3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-9/chain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-9/fullchain3.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-14/cert1.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-14/privkey1.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-14/chain1.pem. [cert_cleanup] Keeping /etc/letsencrypt/archive/npm-14/fullchain1.pem. [cert_cleanup] 36 file(s) kept. [cert_cleanup] 0 file(s) deleted. [app ] [11/4/2024] [8:35:31 AM] [Migrate ] › ℹ info Current database version: none [app ] [11/4/2024] [8:35:31 AM] [Setup ] › ℹ info Logrotate Timer initialized [app ] [11/4/2024] [8:35:31 AM] [Global ] › ⬤ debug CMD: logrotate -s /config/logrotate.status /etc/logrotate.d/nginx-proxy-manager [app ] [11/4/2024] [8:35:32 AM] [Setup ] › ℹ info Logrotate completed. [app ] [11/4/2024] [8:35:32 AM] [IP Ranges] › ℹ info Fetching IP Ranges from online services... [app ] [11/4/2024] [8:35:32 AM] [IP Ranges] › ℹ info Fetching https://ip-ranges.amazonaws.com/ip-ranges.json [app ] [11/4/2024] [8:35:36 AM] [IP Ranges] › ℹ info Fetching https://www.cloudflare.com/ips-v4 [app ] [11/4/2024] [8:35:40 AM] [IP Ranges] › ℹ info Fetching https://www.cloudflare.com/ips-v6 [app ] [11/4/2024] [8:35:44 AM] [SSL ] › ℹ info Let's Encrypt Renewal Timer initialized [app ] [11/4/2024] [8:35:44 AM] [SSL ] › ℹ info Renewing SSL certs expiring within 30 days ... [app ] [11/4/2024] [8:35:44 AM] [IP Ranges] › ℹ info IP Ranges Renewal Timer initialized [app ] [11/4/2024] [8:35:44 AM] [Global ] › ℹ info Backend PID 435 listening on port 3000 ... [app ] [11/4/2024] [8:35:44 AM] [SSL ] › ℹ info Completed SSL cert renew process ``` ![NGINX](https://github.com/user-attachments/assets/1b525893-46b4-482d-9bee-195f33e3b6f0)
Author
Owner

@github-actions[bot] commented on GitHub (May 15, 2025):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2882014585 --> @github-actions[bot] commented on GitHub (May 15, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
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#2672
No description provided.