[GH-ISSUE #2139] 502 Bad Gateway after adding proxy host #1536

Closed
opened 2026-02-26 07:31:27 +03:00 by kerem · 14 comments
Owner

Originally created by @dormancygrace on GitHub (Jul 5, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2139

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

after installing NPM on Oracle Ampere VM with Ubuntu 22.04 and adding any host I'm getting 502 Bad Gateway (openresty). On Oracle Ampere VM with Oracle Linux 8 no such problem, NPM works as expected.

Nginx Proxy Manager Version

2.9.18

Operating System

Oracle Ampere VM, Ubuntu 22.04 (arm64), Portainer, Docker 20.10.17

Originally created by @dormancygrace on GitHub (Jul 5, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2139 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** <!-- A clear and concise description of what the bug is. --> after installing NPM on Oracle Ampere VM with Ubuntu 22.04 and adding any host I'm getting 502 Bad Gateway (openresty). On Oracle Ampere VM with Oracle Linux 8 no such problem, NPM works as expected. **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> 2.9.18 **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> Oracle Ampere VM, Ubuntu 22.04 (arm64), Portainer, Docker 20.10.17
kerem 2026-02-26 07:31:27 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@rmiddle commented on GitHub (Jul 10, 2022):

I opened a duplicate issue #2148 based on the error in the log that was happening when I was getting the same error on the same system.

<!-- gh-comment-id:1179653654 --> @rmiddle commented on GitHub (Jul 10, 2022): I opened a duplicate issue #2148 based on the error in the log that was happening when I was getting the same error on the same system.
Author
Owner

@dormancygrace commented on GitHub (Jul 10, 2022):

I don't use db, so it's another case

<!-- gh-comment-id:1179665785 --> @dormancygrace commented on GitHub (Jul 10, 2022): I don't use db, so it's another case
Author
Owner

@XLixl4snSU commented on GitHub (Oct 17, 2022):

Did you find a solution for this? Experiencing the same and was going crazy because my configuration works on other (amd64) ubuntu machines.

<!-- gh-comment-id:1281043617 --> @XLixl4snSU commented on GitHub (Oct 17, 2022): Did you find a solution for this? Experiencing the same and was going crazy because my configuration works on other (amd64) ubuntu machines.
Author
Owner

@dormancygrace commented on GitHub (Oct 17, 2022):

Did you find a solution for this?

nope =(

<!-- gh-comment-id:1281071863 --> @dormancygrace commented on GitHub (Oct 17, 2022): > Did you find a solution for this? nope =(
Author
Owner

@XLixl4snSU commented on GitHub (Oct 17, 2022):

That's sad. It's so weird, it works on other arm distros, why doesn't it here? Isn't the point of docker providing a smooth experience on every platform?

<!-- gh-comment-id:1281187272 --> @XLixl4snSU commented on GitHub (Oct 17, 2022): That's sad. It's so weird, it works on other arm distros, why doesn't it here? Isn't the point of docker providing a smooth experience on every platform?
Author
Owner

@rmiddle commented on GitHub (Oct 18, 2022):

Try the SQL version and not the mysql version. If the mysql isn't working NPM will give you a 502 Bad Gateway error.

<!-- gh-comment-id:1281779064 --> @rmiddle commented on GitHub (Oct 18, 2022): Try the SQL version and not the mysql version. If the mysql isn't working NPM will give you a 502 Bad Gateway error.
Author
Owner

@XLixl4snSU commented on GitHub (Oct 18, 2022):

@rmiddle I'm not using any db, just the plain SQLite table with the standard docker compose configuration file.

Also I don't see any significant errors in the logs

<!-- gh-comment-id:1281821073 --> @XLixl4snSU commented on GitHub (Oct 18, 2022): @rmiddle I'm not using any db, just the plain SQLite table with the standard docker compose configuration file. Also I don't see any significant errors in the logs
Author
Owner

@XLixl4snSU commented on GitHub (Oct 23, 2022):

It does now work for me but I'm really unsure why. Maybe an ubuntu or docker update fixed some underlying problem.

<!-- gh-comment-id:1288103860 --> @XLixl4snSU commented on GitHub (Oct 23, 2022): It does now work for me but I'm really unsure why. Maybe an ubuntu or docker update fixed some underlying problem.
Author
Owner

@kankadev commented on GitHub (Mar 16, 2023):

Have the same issue. I just deployed the container.

I want to connect my subdomain yacht.example.org to http://localhost:8000. If I open yacht.example.org in the browser I see "502 Bad Gateway".

grafik

docker ps:

CONTAINER ID   IMAGE                             COMMAND   CREATED        STATUS        PORTS                                                                                  NAMES
12dbc3c52e71   jc21/nginx-proxy-manager:latest   "/init"   21 hours ago   Up 21 hours   0.0.0.0:80-81->80-81/tcp, :::80-81->80-81/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   nginx-proxy-manager
14b32cf76e0d   selfhostedpro/yacht               "/init"   2 days ago     Up 2 days     0.0.0.0:8000->8000/tcp, :::8000->8000/tcp                                              yacht
<!-- gh-comment-id:1472374603 --> @kankadev commented on GitHub (Mar 16, 2023): Have the same issue. I just deployed the container. I want to connect my subdomain yacht.example.org to http://localhost:8000. If I open yacht.example.org in the browser I see "502 Bad Gateway". ![grafik](https://user-images.githubusercontent.com/84390410/225698151-e093171b-3767-4b8a-8436-583c100dcea9.png) docker ps: ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 12dbc3c52e71 jc21/nginx-proxy-manager:latest "/init" 21 hours ago Up 21 hours 0.0.0.0:80-81->80-81/tcp, :::80-81->80-81/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp nginx-proxy-manager 14b32cf76e0d selfhostedpro/yacht "/init" 2 days ago Up 2 days 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp yacht ```
Author
Owner

@rmiddle commented on GitHub (Mar 16, 2023):

Have the same issue. I just deployed the container.

I want to connect my subdomain yacht.example.org to http://localhost:8000. If I open yacht.example.org in the browser I see "502 Bad Gateway".

grafik

docker ps:

CONTAINER ID   IMAGE                             COMMAND   CREATED        STATUS        PORTS                                                                                  NAMES
12dbc3c52e71   jc21/nginx-proxy-manager:latest   "/init"   21 hours ago   Up 21 hours   0.0.0.0:80-81->80-81/tcp, :::80-81->80-81/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   nginx-proxy-manager
14b32cf76e0d   selfhostedpro/yacht               "/init"   2 days ago     Up 2 days     0.0.0.0:8000->8000/tcp, :::8000->8000/tcp                                              yacht

Localhost points at the container's, not the host. Instead, you need to use the Host's IP for it to work.

<!-- gh-comment-id:1472639182 --> @rmiddle commented on GitHub (Mar 16, 2023): > Have the same issue. I just deployed the container. > > I want to connect my subdomain yacht.example.org to http://localhost:8000. If I open yacht.example.org in the browser I see "502 Bad Gateway". > > ![grafik](https://user-images.githubusercontent.com/84390410/225698151-e093171b-3767-4b8a-8436-583c100dcea9.png) > > docker ps: > > ``` > CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES > 12dbc3c52e71 jc21/nginx-proxy-manager:latest "/init" 21 hours ago Up 21 hours 0.0.0.0:80-81->80-81/tcp, :::80-81->80-81/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp nginx-proxy-manager > 14b32cf76e0d selfhostedpro/yacht "/init" 2 days ago Up 2 days 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp yacht > ``` Localhost points at the container's, not the host. Instead, you need to use the Host's IP for it to work.
Author
Owner

@carlito31 commented on GitHub (Sep 4, 2023):

Hi, Is there a solution for that ?
I create a new instance in Oracle cloud and I need to put Ip public instead of host ip to work.

Finally I find this : sudo cp /etc/iptables/rules.v4 /etc/iptables/rules.v4.bak && sudo truncate -s 0 /etc/iptables/rules.v4
And it works

<!-- gh-comment-id:1705470362 --> @carlito31 commented on GitHub (Sep 4, 2023): Hi, Is there a solution for that ? I create a new instance in Oracle cloud and I need to put Ip public instead of host ip to work. Finally I find this : sudo cp /etc/iptables/rules.v4 /etc/iptables/rules.v4.bak && sudo truncate -s 0 /etc/iptables/rules.v4 And it works
Author
Owner

@chrwei commented on GitHub (Jan 11, 2024):

instead of clearing the IP tables rules, use the cloud console to add ingress rules
open Networking, virtual cloud networks, drill down though your network, subnet, and security list and add a new ingress rule. for the CIDR use {your public ip}/32 and for destination ports use what you plan to use for for your other containers.

I also and to add one for port 81 for the admin, but used my home IP connection for that CIDR for some extra security. my home Ip rarely changes.

<!-- gh-comment-id:1887501503 --> @chrwei commented on GitHub (Jan 11, 2024): instead of clearing the IP tables rules, use the cloud console to add ingress rules open Networking, virtual cloud networks, drill down though your network, subnet, and security list and add a new ingress rule. for the CIDR use {your public ip}/32 and for destination ports use what you plan to use for for your other containers. I also and to add one for port 81 for the admin, but used my home IP connection for that CIDR for some extra security. my home Ip rarely changes.
Author
Owner

@github-actions[bot] commented on GitHub (Aug 7, 2024):

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

<!-- gh-comment-id:2272471606 --> @github-actions[bot] commented on GitHub (Aug 7, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

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

Issue was closed due to inactivity.

<!-- gh-comment-id:3190418064 --> @github-actions[bot] commented on GitHub (Aug 15, 2025): Issue was closed due to inactivity.
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#1536
No description provided.