nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

502 Bad Gateway after adding proxy host

Open dormancygrace opened this issue 2 years ago • 2 comments

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

dormancygrace avatar Jul 05 '22 18:07 dormancygrace

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.

rmiddle avatar Jul 10 '22 04:07 rmiddle

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

dormancygrace avatar Jul 10 '22 06:07 dormancygrace

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

XLixl4snSU avatar Oct 17 '22 15:10 XLixl4snSU

Did you find a solution for this?

nope =(

dormancygrace avatar Oct 17 '22 15:10 dormancygrace

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?

XLixl4snSU avatar Oct 17 '22 17:10 XLixl4snSU

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

rmiddle avatar Oct 18 '22 03:10 rmiddle

@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

XLixl4snSU avatar Oct 18 '22 05:10 XLixl4snSU

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

XLixl4snSU avatar Oct 23 '22 12:10 XLixl4snSU

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

kankadev avatar Mar 16 '23 17:03 kankadev

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.

rmiddle avatar Mar 16 '23 19:03 rmiddle

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

carlito31 avatar Sep 04 '23 15:09 carlito31

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.

chrwei avatar Jan 11 '24 16:01 chrwei