So, I’m not looking for help, rather putthing this for myself and anyone else experiencing the problem.
How to solve the problem
If you find out that your website is considered not performant, for example using this tool:
https://developers.google.com/speed/pagespeed/insights/
And if the cause is gzip complression not enabled, well the solution is simple, and latest versions should include that by default.
Steps
Go to /etc/nginx/conf.d
and look for your specific site’s folder. You should find a mywebsite__x.conf with a content similar to this:
#--MULTISITE--if (!-e $request_filename) {
#--MULTISITE--rewrite /wp-admin$ $scheme://$host$uri/ permanent;
#--MULTISITE--rewrite ^/(/[^/]+)?(/wp-.*) /$2 last;
#--MULTISITE--rewrite ^/(/[^/]+)?(/.*\.php)$ /$2 last;
#--MULTISITE--}
#sub_path_only rewrite ^/$ / permanent;
location / {
# Path to source
alias /var/www/wordpress__n/;
index index.php;
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
client_max_body_size 30m;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm-wordpress__5.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
Change it to the following:
#--MULTISITE--if (!-e $request_filename) {
#--MULTISITE--rewrite /wp-admin$ $scheme://$host$uri/ permanent;
#--MULTISITE--rewrite ^/(/[^/]+)?(/wp-.*) /$2 last;
#--MULTISITE--rewrite ^/(/[^/]+)?(/.*\.php)$ /$2 last;
#--MULTISITE--}
#sub_path_only rewrite ^/$ / permanent;
location / {
# Path to source
alias /var/www/wordpress__n/;
index index.php;
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
client_max_body_size 30m;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm-wordpress__5.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
gzip on;
# Disabled because it doesn't look good except on Firefox
# add_header Content-Encoding "gzip2";
gzip_vary on;
gzip_disable "msie6";
gzip_min_length 500;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}