NGINX Documentation

Brotli

Brotli is a general-purpose lossless compression algorithm that compresses data using a variant of the LZ77 algorithm, Huffman coding, and 2nd order context modeling. The compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression.

Installation Instructions

  1. Install the Brotli module.

    For Ubuntu:

    $ apt-get install nginx-plus-module-brotli
    

    For SLES:

    $ zypper install nginx-plus-module-brotli
    
  2. Put the following directive in the top-level (“main”) context of the main NGINX Plus configuration file, /etc/nginx/nginx.conf:

    load_module modules/ngx_http_brotli_filter_module.so;
    load_module modules/ngx_http_brotli_static_module.so;
    
  3. Perform additional configuration as required by the module.

  4. Reload NGINX Plus to enable the module:

    $ nginx -t && nginx -s reload