Welcome! Log In Create A New Profile

Advanced

1.7.10 and 1.6.14 always compress response

Posted by Veiko Kukk 
Veiko Kukk
1.7.10 and 1.6.14 always compress response
April 10, 2018 02:50PM
Hi,


Lets run simple query against host (real hostnames replaced).

curl https://testhost01.tld -o /dev/null -vvv

Request headers:

> GET / HTTP/1.1
> Host: testhost01.tld
> User-Agent: curl/7.58.0
> Accept: */*

Response headers:

< HTTP/1.1 200 OK
< Date: Tue, 10 Apr 2018 12:23:44 GMT
< Content-Encoding: gzip
< Content-Type: text/html;charset=utf-8
< Cache-Control: no-cache
< Date: Tue, 10 Apr 2018 12:23:44 GMT
< Accept-Ranges: bytes
< Server: Restlet-Framework/2.3.4
< Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
< Connection: close
< Access-Control-Allow-Origin: *
< Strict-Transport-Security: max-age=15768000

This happens even when either compression algo nor compression type are
specified in haproxy configuration file.

But lets say during request that we don't want any compression:

curl https://testhost01.tld -H "Accept-Encoding: identity" -o /dev/null -vvv

Request headers:

> GET / HTTP/1.1
> Host: testhost01.tld
> User-Agent: curl/7.58.0
> Accept: */*
> Accept-Encoding: identity

Response headers:

< HTTP/1.1 200 OK
< Date: Tue, 10 Apr 2018 12:40:25 GMT
< Content-Encoding: gzip
< Content-Type: text/html;charset=utf-8
< Cache-Control: no-cache
< Date: Tue, 10 Apr 2018 12:40:25 GMT
< Accept-Ranges: bytes
< Server: Restlet-Framework/2.3.4
< Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
< Connection: close
< Access-Control-Allow-Origin: *
< Strict-Transport-Security: max-age=15768000

Still, response is gzipped.

HA-Proxy version 1.6.14-66af4a1 2018/01/02
Copyright 2000-2018 Willy Tarreau <[email protected]>

Build options :
TARGET = linux2628
CPU = generic
CC = gcc
CFLAGS = -m64 -march=x86-64 -O2 -g -fno-strict-aliasing
-Wdeclaration-after-statement -fwrapv
OPTIONS = USE_ZLIB=1 USE_OPENSSL=1 USE_LUA=1 USE_STATIC_PCRE=1

Default settings :
maxconn = 2000, bufsize = 16384, maxrewrite = 1024, maxpollevents = 200

Encrypted password support via crypt(3): yes
Built with zlib version : 1.2.3
Running on zlib version : 1.2.3
Compression algorithms supported : identity("identity"),
deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
Built with OpenSSL version : OpenSSL 1.0.1e-fips 11 Feb 2013
Running on OpenSSL version : OpenSSL 1.0.1e-fips 11 Feb 2013
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes
Built with PCRE version : 7.8 2008-09-05
Running on PCRE version : 7.8 2008-09-05
PCRE library supports JIT : no (USE_PCRE_JIT not set)
Built with Lua version : Lua 5.3.4
Built with transparent proxy support using: IP_TRANSPARENT
IPV6_TRANSPARENT IP_FREEBIND

Available polling systems :
epoll : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 3 (3 usable), will use epoll.

HA-Proxy version 1.6.14-66af4a1 2018/01/02
Copyright 2000-2018 Willy Tarreau <[email protected]>

Build options :
TARGET = linux2628
CPU = generic
CC = gcc
CFLAGS = -m64 -march=x86-64 -O2 -g -fno-strict-aliasing
-Wdeclaration-after-statement -fwrapv
OPTIONS = USE_ZLIB=1 USE_OPENSSL=1 USE_LUA=1 USE_STATIC_PCRE=1

Default settings :
maxconn = 2000, bufsize = 16384, maxrewrite = 1024, maxpollevents = 200

Encrypted password support via crypt(3): yes
Built with zlib version : 1.2.3
Running on zlib version : 1.2.3
Compression algorithms supported : identity("identity"),
deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
Built with OpenSSL version : OpenSSL 1.0.1e-fips 11 Feb 2013
Running on OpenSSL version : OpenSSL 1.0.1e-fips 11 Feb 2013
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes
Built with PCRE version : 7.8 2008-09-05
Running on PCRE version : 7.8 2008-09-05
PCRE library supports JIT : no (USE_PCRE_JIT not set)
Built with Lua version : Lua 5.3.4
Built with transparent proxy support using: IP_TRANSPARENT
IPV6_TRANSPARENT IP_FREEBIND

Available polling systems :
epoll : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 3 (3 usable), will use epoll.
William Lallemand
Re: 1.7.10 and 1.6.14 always compress response
April 10, 2018 03:00PM
On Tue, Apr 10, 2018 at 03:43:12PM +0300, Veiko Kukk wrote:
> Hi,
>

Hi,

>
> This happens even when either compression algo nor compression type are
> specified in haproxy configuration file.
>

If you didn't specify any compression keyword in the haproxy configuration
file, that's probably your backend server which is doing the compression.


--
William Lallemand
Veiko Kukk
Re: 1.7.10 and 1.6.14 always compress response
April 10, 2018 03:20PM
On 04/10/2018 03:51 PM, William Lallemand wrote:
> On Tue, Apr 10, 2018 at 03:43:12PM +0300, Veiko Kukk wrote:
>> Hi,
>>
>
> Hi,
>
>>
>> This happens even when either compression algo nor compression type are
>> specified in haproxy configuration file.
>>
>
> If you didn't specify any compression keyword in the haproxy configuration
> file, that's probably your backend server which is doing the compression.

Actually, you are right.
What is suprising, is that in case of requesting non-compressed from
haproxy, it still passes through compressed data.

Maybe that's how standard specifies, I don't know.

Thanks,
Veiko
Sorry, only registered users may post in this forum.

Click here to login