nghttpx: Returns 408 if backend timed out before sending headers

This commit is contained in:
Tatsuhiro Tsujikawa 2019-09-03 00:29:01 +09:00
parent 8a59ce6d37
commit 053c7ac588
2 changed files with 10 additions and 2 deletions

View File

@ -1378,7 +1378,11 @@ int Http2Upstream::downstream_error(DownstreamConnection *dconn, int events) {
} else { } else {
unsigned int status; unsigned int status;
if (events & Downstream::EVENT_TIMEOUT) { if (events & Downstream::EVENT_TIMEOUT) {
status = 504; if (downstream->get_request_header_sent()) {
status = 504;
} else {
status = 408;
}
} else { } else {
status = 502; status = 502;
} }

View File

@ -893,7 +893,11 @@ int HttpsUpstream::downstream_error(DownstreamConnection *dconn, int events) {
unsigned int status; unsigned int status;
if (events & Downstream::EVENT_TIMEOUT) { if (events & Downstream::EVENT_TIMEOUT) {
status = 504; if (downstream->get_request_header_sent()) {
status = 504;
} else {
status = 408;
}
} else { } else {
status = 502; status = 502;
} }