mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-31 01:05:16 +08:00
Return HTTP 504 when FastCGI connect times out.
This commit is contained in:
parent
5874fbeb7e
commit
9f16ac84a0
@ -81,6 +81,9 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
|
||||
// Connect to FastCGI gateway
|
||||
fcgiBackend, err := rule.dialer.Dial()
|
||||
if err != nil {
|
||||
if err, ok := err.(net.Error); ok && err.Timeout() {
|
||||
return http.StatusGatewayTimeout, err
|
||||
}
|
||||
return http.StatusBadGateway, err
|
||||
}
|
||||
defer fcgiBackend.Close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user