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 Amazon Linux, CentOS, Oracle Linux, and RHEL:

    $ yum install nginx-plus-module-brotli
    

    For Debian and Ubuntu::

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

    For SLES:

    $ 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