fix(backend,nginx): listen on dual-stack [::]:5000 and optimize proxy_next_upstream

This commit is contained in:
2026-09-09 15:19:53 -05:00
parent 4cfe1c47e5
commit ac1495164b
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -130,9 +130,9 @@ func main() {
/* ---------- START & SHUTDOWN ---------- */ /* ---------- START & SHUTDOWN ---------- */
go func() { go func() {
slog.Info("🚀 Starting NBA_Go Fiber API Server on :5000") slog.Info("🚀 Starting NBA_Go Fiber API Server on [::]:5000 (Dual-Stack)")
if err := app.Listen(":5000"); err != nil && !errors.Is(err, http.ErrServerClosed) { if err := app.Listen("[::]:5000"); err != nil && !errors.Is(err, http.ErrServerClosed) {
slog.Error("Failed to listen on :5000", "error", err) slog.Error("Failed to listen on [::]:5000", "error", err)
os.Exit(1) os.Exit(1)
} }
}() }()
+1
View File
@@ -36,6 +36,7 @@ http {
proxy_cache_key "$request_uri"; proxy_cache_key "$request_uri";
proxy_cache_use_stale error timeout updating; proxy_cache_use_stale error timeout updating;
add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-Status $upstream_cache_status;
proxy_next_upstream error timeout http_502 http_503 http_504;
proxy_pass http://go_backend; proxy_pass http://go_backend;
proxy_http_version 1.1; proxy_http_version 1.1;