Downgrade backend request/response to HTTP/1.0

2010-05-04 Thread Dave Pascoe
Is there a way in haproxy 1.4 to perform the equivalent function that
these Apache directives perform?

 SetEnv downgrade-1.0 1
 SetEnv force-response-1.0 1

i.e., force haproxy to downgrade to HTTP/1.0 even though the client is
HTTP/1.1

TIA,
Dave



Re: Downgrade backend request/response to HTTP/1.0

2010-05-04 Thread Holger Just
Hi Dave,

On 2010-05-04 18:55, Dave Pascoe wrote:
> Is there a way in haproxy 1.4 to perform the equivalent function that
> these Apache directives perform?
> 
>  SetEnv downgrade-1.0 1
>  SetEnv force-response-1.0 1
> 
> i.e., force haproxy to downgrade to HTTP/1.0 even though the client is
> HTTP/1.1

I'm not really sure what you are trying to achieve with this (as you
should really reconsider using software which does not understand HTTP
1.1 nowadays), but you could force the HTTP version using the following
statements:

# replace the HTTP version in the request
reqrep ^(.*)\ HTTP/[^\ ]+$ \1\ HTTP/1.0

# and also force HTTP 1.0 in the response
rsprep ^(.*)\ HTTP/[^\ ]+$ \1\ HTTP/1.0

Note that this does not change any headers, so the request and response
are technically still HTTP/1.1, only disguised as HTTP/1.0.

--Holger



Re: Downgrade backend request/response to HTTP/1.0

2010-05-04 Thread Matt
On 4 May 2010 20:43, Holger Just  wrote:

> Hi Dave,
>
> On 2010-05-04 18:55, Dave Pascoe wrote:
> > Is there a way in haproxy 1.4 to perform the equivalent function that
> > these Apache directives perform?
> >
> >  SetEnv downgrade-1.0 1
> >  SetEnv force-response-1.0 1
> >
> > i.e., force haproxy to downgrade to HTTP/1.0 even though the client is
> > HTTP/1.1
>
> I'm not really sure what you are trying to achieve with this (as you
> should really reconsider using software which does not understand HTTP
> 1.1 nowadays), but you could force the HTTP version using the following
> statements:
>
> # replace the HTTP version in the request
> reqrep ^(.*)\ HTTP/[^\ ]+$ \1\ HTTP/1.0
>

I had to this for a short period for some Jetty backends, it worked well
causing the Jetty servers to respond with a HTTP/1.0 response.

Matt