Добавим репозиторий GetPageSpeed

[root@localhost]# yum -y install https://extras.getpagespeed.com/release-el7-latest.rpm

Установим модуль

[root@localhost]# yum -y install nginx-module-nbr

Откроем основной конфиг NGINX и подключим модуль

[root@localhost]# nano /etc/nginx/nginx.conf
...
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
load_module "modules/ngx_http_brotli_filter_module.so";
load_module "modules/ngx_http_brotli_static_module.so";
...

Подключим Brotli компрессию во всех наших сайтах, для этого создадим файл с соответствующим содержимым

[root@localhost]# nano /etc/nginx/conf.d/brotli.conf
brotli on;
brotli_types text/xml
       image/svg+xml
       application/x-font-ttf
       image/vnd.microsoft.icon
       application/x-font-opentype
       application/json
       font/eot
       application/vnd.ms-fontobject
       application/javascript
       font/otf
       application/xml
       application/xhtml+xml
       text/javascript
       application/x-javascript
       text/plain
       application/x-font-truetype
       application/xml+rss
       image/x-icon
       font/opentype
       text/css
       image/x-win-bitmap;
brotli_comp_level 4;

Проверяем конфигурацию NGINX на ошибки и перезагружаем его

[root@localhost]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@localhost]# systemctl restart nginx

Проверяем, подключилось ли сжатие Brotli на сайте

[root@localhost]# curl -IL https://mozgovoy.in.ua -H "Accept-Encoding: br"
...
Content-Encoding: br