nghttpx: Returns 503 if downstream connect fail for https upstream

This commit is contained in:
Tatsuhiro Tsujikawa 2014-08-19 23:41:53 +09:00
parent c7e9fe8154
commit d6b495f2a7
1 changed files with 10 additions and 1 deletions

View File

@ -375,7 +375,16 @@ int HttpsUpstream::on_read()
handler->set_should_close_after_write(true);
pause_read(SHRPX_MSG_BLOCK);
if(error_reply(400) != 0) {
unsigned int status_code;
if(downstream && downstream->get_request_state() ==
Downstream::CONNECT_FAIL) {
status_code = 503;
} else {
status_code = 400;
}
if(error_reply(status_code) != 0) {
return -1;
}