On Sat, Jan 07, 2023 at 09:57:06AM -0700, Shawn Heisey wrote:
> On 1/7/23 09:41, Shawn Heisey wrote:
> > That's really cool.  But I have an oddity I'd like to share and see if
> > it needs some work.
> 
> Semi-related but separate:  I have this line in that frontend:
> 
>   stats uri /redacted
> 
> Which works well ... but it never switches to http/3.  The alt-svc header
> that the frontend specifies is not in the response, even if I move that
> config before stats.
> 
>   http-response add-header alt-svc 'h3=":443"; ma=7200'
> 
> That's not causing me any problems ... it's not like http/2 is slow. :) But
> I did want to mention it, see if you might want to change it.  I suspect
> that for the stats uri there is a lot of frontend config that is ignored.

Indeed, stats intercept the request and response processing and produce
a response directly. You may even remember that years ago it was not
even possible to support compression nor keep-alive due to this. Nowadays
we have to keep this behavior because of the numerous deployed configs
which assume that http-response apply to incoming responses from servers.

However there's a solution nowadays, you can use "http-after-response"
instead of "http-response". It will apply *after* the response, and will
happily overwrite stats, redirects and even error pages. I'd say that
it's the recommended way to place alt-svc now. /me just realises that I
should update the example on the haproxy.org main page by the way.

Willy

Reply via email to