I'm using Brotli for response compression, and doing this in Nginx using nginx-brotli module.
I would like to set the value for brotli_comp_level
dynamically based on the request headers, so that clients on slow networks could request higher compression. How can I achieve this?
I tried to no avail:
http {
...
brotli on;
brotli_comp_level 6;
brotli_types *;
if ($http_x_brotli_high_quality) {
brotli_comp_level 11;
}
}