Goal: I am trying to make a Ubuntu 22.04 server available online.
Approach: I have a fresh VM with Ubuntu, Plesk, docker, docker-compose, papermerge and nginx installed on it.
Problem: When I try to start nginx, this error is prompted:
nginx: [emerg] unknown directive "brotli" in /etc/nginx/conf.d/brotli.conf:1
brotli.conf looks like this:
brotli on;
brotli_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
What would you suggest I do to solve this?
2
Answers
NGINX open source does not have compiled brotli module. You need to compile the NGINX brotli module from source.
Since version 18.0.33 Plesk comes with Nginx and Brotli enabled by default. Make sure it is turned on by running (as root) "plesk bin nginx -e brotli". More details that can help: Plesk KB article on Brotli with Nginx. If you are using Nginx in a Docker container, then indeed it may need be a specially compiled version with Brotli.