Nginx Proxy Manager no certificates and 502 Bad Gateway

Sorry, I’ve tried a lot by now and also searched here and on Google. But unfortunately, the installation of Nginx in Docker is completely different than shown in the video or in the solution approaches I found.

My problem is that Nginx can no longer create certificates. After searching for a solution and trying one thing or another, I’m now only getting a 502 Bad Gateway error.

However, I can’t find any nginx.conf or similar files, and I can’t really find the logs either. Since this is a Docker container installed via Nginx Proxy Manager (NPM), the files should be located there.

I’m really stuck and don’t know what to do next.

well it depends how you setup the container. There you might find the logs and configuration files according your container configuration. Anyway, this is a software title we don’t offer in our catalog and it might be better to contact the container developer.

you should be able to use standard docker commands like following to show logs

docker container logs <container_name>
45704a0ef51f   jc21/nginx-proxy-manager:latest   "/init"             16 hours ago   Up 3 minutes            0.0.0.0:80-81->80-81/tcp, [::]:80-81->80-81/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp   npm-app-1
-------------------------------------
 _   _ ____  __  __
| \ | |  _ \|  \/  |
|  \| | |_) | |\/| |
| |\  |  __/| |  | |
|_| \_|_|   |_|  |_|
-------------------------------------
User:  npm PUID:0 ID:0 GROUP:0
Group: npm PGID:0 ID:0
-------------------------------------

❯ Starting nginx ...
❯ Starting backend ...
[3/4/2025] [5:15:55 AM] [Global   ] › ℹ  info      Using MySQL configuration
[3/4/2025] [5:16:00 AM] [Migrate  ] › ℹ  info      Current database version: 20240427161436
[3/4/2025] [5:16:00 AM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[3/4/2025] [5:16:00 AM] [Global   ] › ⬤  debug     CMD: logrotate /etc/logrotate.d/nginx-proxy-manager
[3/4/2025] [5:16:00 AM] [Setup    ] › ℹ  info      Logrotate completed.
[3/4/2025] [5:16:00 AM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[3/4/2025] [5:16:00 AM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[3/4/2025] [5:16:00 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[3/4/2025] [5:16:01 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[3/4/2025] [5:16:01 AM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[3/4/2025] [5:16:01 AM] [SSL      ] › ℹ  info      Renewing SSL certs expiring within 30 days ...
[3/4/2025] [5:16:01 AM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[3/4/2025] [5:16:01 AM] [Global   ] › ℹ  info      Backend PID 161 listening on port 3000 ...
[3/4/2025] [5:16:01 AM] [SSL      ] › ℹ  info      Completed SSL cert renew process

I have now restarted the server. The logs don’t look suspicious to me. But the site is still showing a 502 error.

"Sorry, I was able to solve the problem. The first issue was with the Apache on the other side. The second problem was that I had set AdGuard as the DNS server. However, since DNS redirects were already active there, Nginx couldn’t create certificates anymore. After I adjusted the

 /etc/resolv.conf

and added the Google DNS servers, everything is working again. Sorry again for causing you the trouble."