mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #1021] Restarting docker containers may change its IP address and cause '502 bad gateway' #856
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#856
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GeorgeWells on GitHub (Apr 15, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1021
I've put together a docker-compose file with 2 services (php:8.0-fpm-alpine and nginx:stable-alpine) within the same network as nginx-proxy-manager and have a proxy host record pointing to the name of the nginx service. I have found that sometimes when I run
docker-compose downand thendocker-compose up -dI may get a 502 error. This does disappear after a while which I believe matches up with my findings.I have found that when running
docker network inspect NETWORKNAMEbetween each time I run the above commands I have noticed that the 502 error happens when the IP address of the nginx container changes and then the error goes away once DNS has re-cached its IP address from the service name. I've also noticed that I can disable then re-enable the proxy record to resolve the 502 error which I believe triggers an nginx reload in the proxy manager.I'm not sure if the IP address should always be the same therefore a potential bug/issue with docker or something can be done in reverse-proxy-manager to ensure that the IP address that is mapped to the service name is updated when a 502 happens. Maybe something in cron to re-cache the IP addresses for all the proxy records every 3-5 minutes would help to diminish the issue.
I'm using Docker 20.10.6 on a Raspberry Pi 4 (Raspberry Pi OS - Buster 32bit).
@github-actions[bot] commented on GitHub (Mar 13, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@Automatik commented on GitHub (Jan 28, 2025):
I'm having the same issue!
@github-actions[bot] commented on GitHub (Aug 21, 2025):
Issue is now considered stale. If you want to keep it open, please comment 👍
@urbenlegend commented on GitHub (Feb 9, 2026):
This happens to me as well in my Podman containers. For me, I find that it only happens to custom locations, not the main host itself. For example, I have a Nextcloud instance that has custom locations for the whiteboard and notify_push.
Domain Name: nextcloud-domain.com
Scheme: http, Forward Hostname / IP: nextcloud, Port: 80
Custom Location 1: /whiteboard/
Scheme: http, Forward Hostname / IP: nextcloud-whiteboard-server/, Port: 3002
Custom Location 2: /push/
Scheme: http, Forward Hostname / IP: nextcloud-notify-push/, Port: 7867
If I reboot my Nextcloud docker-compose, it takes a few seconds for the main domain to come up but it does eventually come up. /whiteboard/ and /push/ however do not.