Correct behavior for timeout would be to respond with 504 Gateway Timeout. For other upstream errors 502 Bad Gateway. This would be a separate fix though so I'm going to merge this.