mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 10:37:24 -04: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 | 			// 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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user