bugfix: modifying the Connection request header via ngx.req.set_header or ngx.req.clear_header did not update the special internal flags in the Nginx core, "r->headers_in.connection_type" and "r->headers_in.keep_alive_n". Thanks Matthieu Tourne for the patch.