Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP proxy error status codes

The application is Node.js based web crawler that does requests to remote servers via request library.

Requests are made through authenticated HTTP proxy servers with 99% and higher uptime, provided by third party vendor.

I'm trying to process HTTP codes for request errors response that can be likely caused by malfunctioning proxy. It's expected that after reaching a threshold of these HTTP codes, a flag that a proxy is unreliable will be triggered, so a proxy will be queued for diagnostics. And I expect some codes to have more weight.

Currently I'm processing 407 (proxy authentication) and 408 (request timeout) HTTP codes for proxies.

Are there other HTTP codes that are commonly caused by malfunctioning HTTP proxies?

I hope the question is specific enough. I assume that possible malfunction (and a set of possible HTTP error status codes) depends on actual proxy and its environment. We should consider these proxies black boxes because they are provided by a third party.

The question isn't about HTTP status codes in general, only error codes can be caused by malfunctioning proxies (forward proxies).

like image 640
Estus Flask Avatar asked Oct 16 '22 20:10

Estus Flask


1 Answers

According to HAProxy docs (one of the most popular proxy solution)

Haproxy may emit the following status codes by itself:

  • 200 access to stats page, and when replying to monitoring requests
  • 301 when performing a redirection, depending on the configured code
  • 302 when performing a redirection, depending on the configured code
  • 303 when performing a redirection, depending on the configured code
  • 307 when performing a redirection, depending on the configured code
  • 308 when performing a redirection, depending on the configured code
  • 400 for an invalid or too large request
  • 401 when an authentication is required to perform the action (when accessing the stats page)
  • 403 when a request is forbidden by a "block" ACL or "reqdeny" filter

  • 408 when the request timeout strikes before the request is complete

  • 500 when haproxy encounters an unrecoverable internal error, such as a memory allocation failure, which should never happen
  • 502 when the server returns an empty, invalid or incomplete response, or when an "rspdeny" filter blocks the response.
  • 503 when no server was available to handle the request, or in response to monitoring requests which match the "monitor fail" condition
  • 504 when the response timeout strikes before the server responds
like image 58
Alexey B. Avatar answered Oct 21 '22 11:10

Alexey B.