Currently, when proxy_connect fails to hit something, it gives the following response, which doesn't include any additional info as to why the request failed:
$ curl -x localhost:5901 -i https://namethatdoesnotresolve
HTTP/1.1 502 Bad Gateway
Server: nginx/1.12.2
Date: Tue, 07 Jan 2020 20:38:48 GMT
Content-Type: text/html
Content-Length: 173
Connection: close
How it could be?
When squid hits this sort of problem, it gives a response like this:
HTTP/1.1 503 Service Unavailable
Server: squid/squid version
Mime-Version: 1.0
Date: Tue, 07 Jan 2020 20:09:31 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 3505
X-Squid-Error: ERR_DNS_FAIL 0
Vary: Accept-Language
Content-Language: en
Connection: keep-alive
(with the response body including a more detailed error message)
But I think giving a status code of 503 and a special X-Proxy-Connect-Error header with more info would be sufficient.
Why you need it?
Currently, when proxy_connect fails to hit something, it gives the following response, which doesn't include any additional info as to why the request failed:
How it could be?
When squid hits this sort of problem, it gives a response like this:
(with the response body including a more detailed error message)
But I think giving a status code of 503 and a special X-Proxy-Connect-Error header with more info would be sufficient.