X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/14e316cd3e1ab5f25a54d0765ebad61ac665ccb4..5bb7bf7aa78aa8bc9876f3ec3502572f4b6809d3:/cookbooks/matomo/templates/default/apache.erb?ds=sidebyside diff --git a/cookbooks/matomo/templates/default/apache.erb b/cookbooks/matomo/templates/default/apache.erb index 589d563d6..525d1fbcc 100644 --- a/cookbooks/matomo/templates/default/apache.erb +++ b/cookbooks/matomo/templates/default/apache.erb @@ -8,7 +8,7 @@ SSLCertificateFile /etc/ssl/certs/matomo.openstreetmap.org.pem SSLCertificateKeyFile /etc/ssl/private/matomo.openstreetmap.org.key - CustomLog /var/log/apache2/matomo.openstreetmap.org-access.log combined + CustomLog /var/log/apache2/matomo.openstreetmap.org-access.log combined_extended ErrorLog /var/log/apache2/matomo.openstreetmap.org-error.log Options -Indexes @@ -31,7 +31,7 @@ SSLCertificateFile /etc/ssl/certs/matomo.openstreetmap.org.pem SSLCertificateKeyFile /etc/ssl/private/matomo.openstreetmap.org.key - CustomLog /var/log/apache2/matomo.openstreetmap.org-access.log combined + CustomLog /var/log/apache2/matomo.openstreetmap.org-access.log combined_extended ErrorLog /var/log/apache2/matomo.openstreetmap.org-error.log RedirectPermanent / https://matomo.openstreetmap.org/ @@ -44,7 +44,7 @@ ServerAlias piwik.osm.org ServerAdmin webmaster@openstreetmap.org - CustomLog /var/log/apache2/matomo.openstreetmap.org-access.log combined + CustomLog /var/log/apache2/matomo.openstreetmap.org-access.log combined_extended ErrorLog /var/log/apache2/matomo.openstreetmap.org-error.log RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ @@ -57,23 +57,32 @@ ExpiresActive On RewriteEngine on - RewriteCond "%{HTTP:Accept-encoding}" "gzip" + RewriteCond "%{HTTP:Accept-Encoding}" "br" + RewriteCond "%{REQUEST_FILENAME}\.br" -s + RewriteRule "^(.*)\.js" "$1\.js\.br" [QSA] + + RewriteCond "%{HTTP:Accept-Encoding}" "gzip" RewriteCond "%{REQUEST_FILENAME}\.gz" -s RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA] - RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1] + RewriteRule "\.js\.(br|gz)$" "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1] + + + Header append Content-Encoding br + Header append Vary Accept-Encoding + Header append Content-Encoding gzip Header append Vary Accept-Encoding - + ExpiresDefault "access plus 1 week" Header set Cache-Control "max-age=604800" - SetHandler "proxy:unix:/run/php/matomo.openstreetmap.org.sock|fcgi://127.0.0.1" + SetHandler "proxy:unix:/run/php/php-matomo.openstreetmap.org-fpm.sock|fcgi://127.0.0.1"