Home > OS >  HTTP/1.1 request response is not compressed by nginx with gzip_http_version 1.1
HTTP/1.1 request response is not compressed by nginx with gzip_http_version 1.1

Time:10-16

The nginx documentation for gzip_http_version says:

[gzip_http_version] Sets the minimum HTTP version of a request required to compress a response.

The problem is that when I configure nginx with gzip_http_version 1.1 and make a request with HTTP/1.1 and Accept-Encoding: gzip the response is not compressed.

However, this problem disappears when I configure nginx with gzip_http_version 1.0 (with the rest of the config untouched).

Am I misunderstanding something of how this option works? I'm using nginx 1.14.0 on Ubuntu 18.

CodePudding user response:

User error.

The nginx server from which I was requesting the resource was behind a separate nginx proxy. The real fix was configuring nginx proxy server with proxy_http_version 1.1 (which by default is 1.0).

The gzip_http_version works as described in documentation.

  • Related