mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Return HTTP 504 when FastCGI connect times out.
This commit is contained in:
parent
5874fbeb7e
commit
9f16ac84a0
1 changed files with 3 additions and 0 deletions
|
@ -81,6 +81,9 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
|
||||||
// Connect to FastCGI gateway
|
// Connect to FastCGI gateway
|
||||||
fcgiBackend, err := rule.dialer.Dial()
|
fcgiBackend, err := rule.dialer.Dial()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err, ok := err.(net.Error); ok && err.Timeout() {
|
||||||
|
return http.StatusGatewayTimeout, err
|
||||||
|
}
|
||||||
return http.StatusBadGateway, err
|
return http.StatusBadGateway, err
|
||||||
}
|
}
|
||||||
defer fcgiBackend.Close()
|
defer fcgiBackend.Close()
|
||||||
|
|
Loading…
Reference in a new issue