# One Word Fixed a 60-Second nginx Delay

DevFeed: [One Word Fixed a 60-Second nginx Delay](<https://devfeed.tech/articles/one-word-fixed-a-60-second-nginx-delay-112287.md>)

Original publisher: [Read original article](<https://blog.devops.dev/one-word-fixed-a-60-second-nginx-delay-a25e16b7f210?source=rss----33f8b2d9a328---4>)

Author: DRAVID KUMAR

Published: 2026-11-01T20:01:02Z

Content type: article

Language: en

Sources: [DevOps.dev](<https://devfeed.tech/sources/devops-dev.md>)

Topics: [nginx](<https://devfeed.tech/topics/nginx.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [cURL](<https://devfeed.tech/topics/curl.md>), [Domain Name System (DNS)](<https://devfeed.tech/topics/dns-resolution-process.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [all](<https://devfeed.tech/tags/all.md>), [assets](<https://devfeed.tech/tags/assets.md>), [auth](<https://devfeed.tech/tags/auth.md>), [bash](<https://devfeed.tech/tags/bash.md>), [browser](<https://devfeed.tech/tags/browser.md>), [but](<https://devfeed.tech/tags/but.md>), [command](<https://devfeed.tech/tags/command.md>), [connect](<https://devfeed.tech/tags/connect.md>), [crashes](<https://devfeed.tech/tags/crashes.md>), [curl](<https://devfeed.tech/tags/curl.md>), [days](<https://devfeed.tech/tags/days.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [delay](<https://devfeed.tech/tags/delay.md>), [devops](<https://devfeed.tech/tags/devops.md>), [fixed](<https://devfeed.tech/tags/fixed.md>), [linux](<https://devfeed.tech/tags/linux.md>), [nginx](<https://devfeed.tech/tags/nginx.md>), [one](<https://devfeed.tech/tags/one.md>), [productivity](<https://devfeed.tech/tags/productivity.md>), [word](<https://devfeed.tech/tags/word.md>)

## AI overview

An nginx reverse proxy caused intermittent 60-second delays on Google sign-in because `localhost` resolved to both IPv6 and IPv4. On slow requests nginx tried `[::1]:5000`, where no service was listening, waited for its 60-second connection timeout, then retried the working IPv4 address. Direct requests to the app were fast, and the nginx error log recorded upstream connection timeouts. Replacing `proxy_pass http://localhost:5000;` with `proxy_pass http://127.0.0.1:5000;` resolved the stalls in the reported checks: five slow requests in a 15-request sample before, none in nine requests after, plus a successful browser sign-in. The author could not confirm what triggered the issue two days earlier. As prevention, the account recommends using explicit IPv4 addresses for local nginx upstreams, monitoring timeout logs, and considering a shorter `proxy_connect_timeout`; these steps are reported recommendations, not further tested outcomes.

## Source excerpt

Part of my ongoing DevOps series. Previously: Flask on VPS | Grafana Reverse Proxy | Linux LVM NOTE: This is a real production incident. Domain names and service names are changed. Every command below was actually run -- nothing is theoretical. The Symptom: Users Were Waiting a Full Minute to Sign In Every third Google sign-in request to auth.example.com stalled for about 60 seconds. Users clicked "Sign in with Google" and the page just sat there. Some waited. Some retried. Some probably gave up and never came back. Google sign-in had worked normally until about two days earlier. Here's what made it maddening: Nothing visibly failed. No error pages, no crashes. Every sign-in eventually succeeded -- only a minute late. Google wasn't slow. Google's own pages loaded in about 1 second. Most callbacks were fast. All static assets on the main site were under 0.3 seconds. It was intermittent. Exactly every third request. A pattern, not randomness. And the one detail that kept me up at night: email/password login worked perfectly. It went straight to the auth service inside Docker and never touched this nginx route. So the problem was isolated. But hidden. The Investigation: Seven Steps to the Truth Each step ruled something out. Here's exactly how we narrowed it down. Step 1: Browser HAR -- The First Clue Captured during a slow sign-in: MeasurementResultGET /auth/google60,165 msDNS + connect + TLS~40 msGoogle's pages~1.0 sCallback~0.5 s Ruled out: The network and Google. The delay is on our auth server. Step 2: Single Curl -- The Problem Is Intermittentcurl -w "Time: %{time_total}s\n" -o /dev/null -s "https://auth.example.com/auth/google" Result: 302 in 0.34 s. Showed: The problem is intermittent, not constant. One request proves nothing. Step 3: Curl Loop -- The Pattern Emerges bash for i in {1..15}; do curl -w "Request $i: %{time_total}s\n" -o /dev/null -s "https://auth.example.com/auth/google" sleep 20 done Result: RequestTime160.2 s20.8 s31.2 s460.7 s50.4 s60.9 s760.1 s80.3