Welcome! Log In Create A New Profile

Advanced

Re: Using single persistent socket to send subrequests

Francis Daly
February 01, 2022 04:30AM
On Wed, Jan 26, 2022 at 07:18:02AM +0000, Devashi Tandon wrote:

Hi there,

You may or may not have seen a parallel mail with the Subject:
auth_request sub requests not using upstream keepalive.

> I tried with clearing the connections header but NGINX is still sending
> the 5th response through a new source port. Let me give a more detailed
> configuration we have. Just to inform you, we have our own auth module
> instead of using the NGINX auth module. We call ngx_http_post_request to
> post subrequests and the code is almost the same as that of auth module.

A response there indicates that for the stock nginx auth_request,
if there is any body content in the response, that leads to the tcp
connection being closed.

If your module does the same, then you probably want to either make sure
that the auth module response has no body; or make sure that your auth
module reads the response body.

In very light testing with "keepalive 3;", I saw the same tcp connection
being re-used for subsequent requests (from the same client) when the
auth response had no body; and new connections being used when the auth
response had a body.

So I suspect that that is the piece that is missing in your setup.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

Re: Using single persistent socket to send subrequests

Francis Daly February 01, 2022 04:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 140
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready