You have to maintain an active subscription in order to be able to use the repository!
Plesk is a modern alternative to cPanel and provides a web interface for managing websites in bulk.
Although my personal view on control panels is beyond negative, I’ve spent some time looking at how to get a missing feature for Plesk – Brotli compression.
Why did I bother? I’ve had a repository subscriber asking whether NGINX modules are compatible with Plesk.
My answer was that “Plesk is likely to have their own repo”.
Later this was confirmed and I simply got curious whether things with Plesk can be improved with supplementary packaging effort.
And so, meet Brotli NGINX module for Plesk. Let’s go through some quick steps on bringing Brotli compression to Plesk.
- CentOS/RHEL 7 or CentOS/RHEL 8
- Latest Plesk
- 2 minutes of free time
Step 1. Install GetPageSpeed repository
sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm
Needless to say, you have to subscribe.
Step 2. Install Brotli NGINX module
sudo yum install sw-nginx-module-nbr
Step 3. Enable Brotli module
sudo plesk sbin nginx_modules_ctl --enable brotli
Step 4. Enable Brotli compression for all websites
Create the file
/etc/nginx/conf.d/brotli.conf with contents:
sudo nginx -t && sudo systemctl restart nginx
(we have to restart NGINX as opposed to reloading its config due to a bug in Plesk).
As an alternative to enabling Brotli for all websites, you can enable Brotli compression for a specific website only.
Open website’s settings in Plesk admin and navigate to its Hosting & DNS -> Apache & nginx Settings .
Scroll down to “Additional nginx directives” and paste in the same lines as above.
Then similarly, restart NGINX.
Welcome to NGINX with Brotli support 🙂