mirror of
https://github.com/niels-emmer/myace.git
synced 2026-09-14 07:36:39 +02:00
[PR #83] [MERGED] fix: prevent nginx 502 after backend container restart via runtime DNS resolution #85
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
github-mirrors/myace#85
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?
📋 Pull Request Information
Original PR: https://github.com/niels-emmer/myace/pull/83
Author: @niels-emmer
Created: 8/12/2026
Status: ✅ Merged
Merged: 8/12/2026
Merged by: @niels-emmer
Base:
main← Head:fix/nginx-dns-resolution📝 Commits (1)
adaeacdfix: prevent nginx 502 after backend container restart via runtime DNS resolution📊 Changes
2 files changed (+27 additions, -1 deletions)
View changed files
📝
docs/debugging.md(+21 -0)📝
frontend/nginx.conf(+6 -1)📄 Description
Summary
nginx resolves upstream hostnames at startup and caches the IP. When the backend container is recreated during deploy, it gets a new Docker-internal IP and nginx 502s until restarted. This happened on the previous deploy — the postgres-backup sidecar PR rebuilt the backend, and the frontend's nginx was still pointing at the old IP.
Fix
Use a variable in
proxy_pass(set $backend_upstream), which forces nginx to resolve DNS at runtime instead of caching at startup.Changes
frontend/nginx.confproxy_passnow uses$backend_upstreamvariabledocs/debugging.mdTesting
docker compose -f docker-compose.yml -f docker-compose.dev.yml configvalidatesdocker compose restart frontendstepChecklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.