NginxProxyManager / nginx-proxy-manager

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

"Bad Gateway" after adding a proxy host and a certificate #3788

Open guillaumesoucy94 opened 3 months ago

guillaumesoucy94 commented 3 months ago

Checklist

Describe the bug

"Bad Gateway" when trying to login. Was able to login and add an proxy host and when I add the certificate to the host (certificate obtained but with a time out error" every hosts entries get gone and when I log off and try to log back in, it gave me that "bad gateway" error.

The proxy is still working, just can't login and make changes.

Nginx Proxy Manager Version

v2.11.2

To Reproduce Steps to reproduce the behavior: I go to my NPM instance using its IP address like the usual then I try to login.

Expected behavior

The management page as usual.

Screenshots

Screenshot at 2024-06-02 13-22-59_1

Operating System

Ubuntu Server 20.04 LTS (Upgraded to 22.04 LTS to see if it would fix it but no).

Additional context

LukeHoneyball commented 3 months ago

Certificates normally mess with things. Make sure the certificate allows the necessary traffic through...

guillaumesoucy94 commented 3 months ago

Yeah this what I thought. Things breaks right after attempting to create a certificate.

I forgot that the sub domain wasn't created yet on my registrar before requesting the certificate.

Do you know now how I can fix this mess?

Thanks,

Guillaume

LukeHoneyball commented 3 months ago

Did it work after registering the sub-domain?

If not, I doubt it would be an issue with the certificate and its registrar, but then as you described, an nginx proxy bug...

If that's the case, I doubt I would be of any help further, as I don't specialize in nginx software and I'm not affiliated in any way with it...

Hopefully a developer will help you out. Good luck!

guillaumesoucy94 commented 2 months ago

What happened is that I requested the certificate without having created the dns entry for the subdomain at first.

So, it fails to request it, possibility because of that.

I realized the mistake, I quickly proceeded with the DNS entry creation from my domain registration interface, but it didn't fix the issue.

Guillaume

Edit

If someone from the dev team can please also give a look at the issue.

This morning, I noticed that some of my certificates just expired. Affected websites and hosted apps are now throwing certificate issues.

And also @LukeHoneyball thanks for at least getting a look into the issue. I really appreciate it 🙏

guillaumesoucy94 commented 1 month ago

Hello,

I still need help with the issue. It's still saying "bad gateway" when trying to login.

Thanks,

Guillaume

guillaumesoucy94 commented 1 month ago

fallback_error.log file is full of lines like:

2024/07/11 22:20:26 [error] 347#347: *109 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.2.100, server: nginxproxymanager, request: "POST /api/tokens HTTP/1.1", upstream: "http://127.0.0.1:3000/tokens", host: "192.168.2.136:81", referrer: "http://192.168.2.136:81/login"

guillaumesoucy94 commented 1 month ago

Any ideas? Please? A lot of my sites aren't working properly now...

LukeHoneyball commented 1 month ago

Yea sorry mate i cant really help you further. Try getting a staff member into this?

tinetoalves commented 1 month ago

Hello, I have the same issue happening in my environment. If I stack a new npm, I can access and configure all services/sites. However, when I issued a new certificate for a site, if I logout the admin page, I cannot access again and get the 'bad gateway' with the identical message on fallback_error.log.

riruigit commented 1 month ago

me too , and i not good idea to deal with

guillaumesoucy94 commented 4 weeks ago

Hello,

Just want to add that I will soon running NPM from a physical machine rather than on a VM, for capacity related reasons. I will also need to know how to migrate every hosts to another instance of NPM. It is something possible to do? Or, how to obtain a list of every hosts so I will be able to recreate them manually? As I cannot remember every of them.

Regards,

Guillaume