Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TODO] Customize connection error/status code #137

Open
jrgp opened this issue Jan 7, 2020 · 1 comment
Open

[TODO] Customize connection error/status code #137

jrgp opened this issue Jan 7, 2020 · 1 comment
Labels

Comments

@jrgp
Copy link

jrgp commented Jan 7, 2020

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:

$ 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.

@chobits chobits added the TODO label Jan 17, 2020
@chobits
Copy link
Owner

chobits commented Jan 17, 2020

Hi @jrgp

Thanks for your idea, will add it in one month.
Before that, you can check the error log to get detailed error message.

@chobits chobits changed the title Customize connection error/status code [TODO] Customize connection error/status code Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants