I recently noticed that Google PageSpeed was complaining to me about “Enable text compression” for my CapRover applications.
To enable gzip compression in CapRover, it’s not enough to enable it on your application web server inside your Docker container, you also need to enable it in the global CapRover Nginx proxy server.
To do so, go to Settings > Base Config Location in nginx container
Go down to the line that says
# gzip on;
Replace it with the following:
Press Save and Update and wait for Nginx to reload.
Your config should now look like this:
example.org with your site URL):
curl -H "Accept-Encoding: gzip" https://example.org --output -
If you see garbled output in the console, it means gzip is now enabled!