NGINX Documentation

Brotli

Brotli is a general‑purpose, lossless data compression algorithm that uses a variant of the LZ77 algorithm, Huffman coding, and second‑order context modeling. Its compression ratio is comparable to the best currently available general‑purpose compression methods. Its speed is similar to DEFLATE but with denser compression.

Installation Instructions

  1. Install the Brotli module.

    For CentOS 8.x, Oracle Linux 8.x, and RHEL 8.x:

    $ yum install nginx-plus-module-brotli
    

    For Debian 10 and Ubuntu::

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

    For SLES 15:

    $ zypper install nginx-plus-module-brotli
    
  2. Put the load_module directives in the top‑level (“main”) context of NGINX Plus configuration file, 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
    

More Info