Hi,
In the location rewrite_by_lua_file script file, I check the "connection" header and also add one if it does not exist.
local h = ngx.req.get_headers()
for k, v in pairs(h) do
ngx.log(ngx.ERR, "header key "..k.." header value "..v)
end
local connheader = ngx.req.get_headers()["connection"]
if (connheader == nil) then
ngx.log(ngx.ERR,"src webservice connection header is null")
ngx.req.set_header("connection", "Keep-Alive")
elseif (connheader ~= nil and connheader ~= "close") then
ngx.log(ngx.ERR,"src webservice connection header is not null"..connheader)
-- ngx.header["connection"] = nil
ngx.req.set_header("connection", "")
end
Even ngx.req.set_header("connection", "Keep-Alive") is executed, at the upstream server log, I still find that "connection: close".
Why? Any suggestion?
Thanks
tjliupeng