mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
fix(backend,nginx): listen on dual-stack [::]:5000 and optimize proxy_next_upstream
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user