ngx_http_unbrotli_filter_module is a filter that decompresses responses with “Content-Encoding: brotli” for clients that do not support “brotli” encoding method. The module will be useful when it is desirable to store data compressed to save space and reduce I/O costs.
This Nginx module is currently considered experimental.
server {
listen 127.0.0.1:8080;
server_name localhost;
location / {
# enable brotli decompression for clients that do not support brotli compression
unbrotli on;
proxy_pass http://foo.com;
}
}
To use theses modules, configure your nginx branch with --add-module=/path/to/ngx_http_unbrotli_filter_module
. Additionally, you need to pre-build the brotli decompression library.
Syntax: unbrotli on | off;
Default: unbrotli off;
Context: http, server, location
Enables or disables decompression of brotli compressed responses for clients that lack brotli support.
Syntax: unbrotli_force string ...;
Default: -
Context: http, server, location
Defines the conditions for forced brotli decompression. If at least one value in the string parameter is not empty and not equal to "0", forced brotli decompression is performed. But it will not try to decompress responses that do not contain the response header Content-Encoding: br
Syntax: unbrotli_buffers number size;
Default: unbrotli_buffers 32 4k | 16 8k;
Context: http, server, location
Sets the number and size of buffers used to decompress a response. By default, the buffer size is equal to one memory page. This is either 4K or 8K, depending on a platform.
This module is forked from ngx_unbrotli