NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.47k stars 2.72k forks source link

502 Bad Gateway after adding proxy host #2139

Open dormancygrace opened 2 years ago

dormancygrace commented 2 years ago

Checklist

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

rmiddle commented 2 years ago

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.

dormancygrace commented 2 years ago

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

XLixl4snSU commented 2 years ago

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

dormancygrace commented 2 years ago

Did you find a solution for this?

nope =(

XLixl4snSU commented 2 years ago

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?

rmiddle commented 2 years ago

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

XLixl4snSU commented 2 years ago

@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 commented 2 years ago

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

kankadev commented 1 year ago

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
rmiddle commented 1 year ago

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.

carlito31 commented 1 year ago

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

chrwei commented 10 months ago

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.

github-actions[bot] commented 3 months ago

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