NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

Errors and troubleshooting

What is HTTP 499 Client Closed Request?

499 is a non-standard code that nginx writes to its logs when the client closes the connection before the server has sent a response. No client ever receives it; it records that the client gave up.

The answer

499 is not part of the HTTP standard. nginx uses it internally to log requests where the client disconnected while nginx was still waiting for the upstream application. Since the client is already gone, the 499 is never sent anywhere; it only appears in access logs and in monitoring dashboards built on them. If you run a scraper, you will not see a 499 response. You will see your own timeout or cancellation error, and the site's logs record it as 499.

When you will actually meet a 499

  • Your own infrastructure. If your scraper sits behind your own nginx (for example an internal API that triggers scrape jobs), its logs show 499 whenever callers time out before the job returns.
  • A proxy service's logs or dashboard. Some providers show per-request status from their side, including 499 when your client disconnected.
  • Load balancers and CDNs. Some edge services report client disconnects with similar codes in their analytics.

What causes it

The client closed the connection first. Typical reasons:

  • A client timeout shorter than the time the server needs, for slow searches, reports or heavy pages.
  • A user or program cancelling the request, such as an AbortController in JavaScript or a task being cancelled in asyncio.
  • A crashing or restarting worker that drops open connections.
  • A load balancer or proxy in front of the client timing out and closing its side.

What it means for a scraper

From your side, the symptom is a timeout exception. Two questions decide the fix. Is the server genuinely slow for these pages? Then raise the read timeout for that endpoint, not globally. Or is something on your path cutting the connection, such as a proxy with a short limit? Then compare timings with and without the proxy.

import httpx

slow_report = httpx.Timeout(connect=5.0, read=90.0, write=10.0, pool=5.0)
with httpx.Client(timeout=slow_report) as hc:
    r = hc.get("https://reports.example.org/export?range=90d")
    print(r.status_code, len(r.content))

Setting a separate, longer read timeout for the few slow endpoints avoids both 499 entries in the site's logs and wasted work, since the server often keeps computing the response after you disconnected.

Why it matters to the site

For the site, every 499 is wasted work: the backend may still run the query to completion and then find nobody to send it to. A scraper that times out aggressively and retries immediately makes this worse, multiplying the load on expensive pages. That pattern can draw attention and lead to rate limiting or blocks. Use backoff between retries, as described under exponential backoff, and fetch expensive pages less often.

499 in your own CAPTCHA workflow

If you built an internal service that wraps CAPTCHA solving (for example, an endpoint that a scraper calls and that returns a token when ready), long-polling clients with short timeouts will produce 499 entries in that service's nginx logs. Either raise the client timeout above the time a solve can take, or switch to the pattern the GateSolver API itself uses: return a task id immediately and let callers poll for the result with short requests. That design never holds a connection open for the full solve, as described under task polling.

Finding 499s in your own logs

If you operate nginx in front of a scraping service, count 499 entries per endpoint and compare them with the $request_time logged for each. Clusters of 499 at a round number of seconds (30, 60) point to a client or load balancer with that timeout. Raising the limit on the caller, or returning faster with a job id, removes them.

Related codes

Compare 499 with 408, where the server gave up waiting for the client to send, and with 504, where a gateway gave up waiting for an upstream. 499 is the mirror image of 504: the client gave up first.

Common questions

Can my HTTP client receive a 499 status?

No. The client has already disconnected when nginx logs it, so nothing is sent back.

Is 499 an official HTTP status code?

No. It is an nginx-specific code used in logs for client-closed requests.

How do I stop causing 499s on a site?

Give slow endpoints a longer read timeout, and back off before retrying instead of retrying at once.

Why do I see 499s in my own server logs?

Clients of your service time out or cancel before your backend responds, often during long operations.

Does the server stop working when it logs 499?

Not always. The backend may finish the work anyway, which is why frequent 499s waste server capacity.

Keep reading