What's the better way to handle upstream connection timeouts. I am trying to add a custom header when upstream connection times out; tried to match it with 408 and still fails,
local status = ngx.status
if status == 408 then
ngx.header["Connection-Timedout"] = "true"
end
Can you please help me here.