<div dir="ltr">Hi--<div><br></div><div>I was exploring using auth_request from the ngx_http_auth_request_module, and I have encountered some unexpected behavior with regard to HTTP keepalive/connection reuse. I have some configuration that looks roughly like this:</div><div><br></div><div>location = /auth_check {<br>  proxy_pass_request_body off;<br>  proxy_set_header Content-Length '';<br>  proxy_http_version 1.1;<br>  proxy_set_header Connection '';<br>  proxy_pass <a href="https://upstream_with_keepalive_confugred">https://upstream_with_keepalive_confugred</a>;<br>}<br><br>location /private {<br>  auth_request /auth_check;<br>  proxy_pass <a href="http://some_backend">http://some_backend</a>;<br>}<br></div><div><br></div><div>When I make a series of requests to /auth_check, nginx uses an existing connection as confirmed by tcpdump, but when I make a series of requests to /private, each /auth_check is closing the TCP connection at the end and then creating a new one for the following request. In my particular use-case this leads to approximately double the latency of the calls that use auth_request. Is this the expected behavior/a known issue with auth_request/http subrequests in general?</div><div><br></div><div>Thank you,</div><div>Zach</div></div>