X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/ba9dff51d4737f22436abe1359d3b24f7f69e8fd..a406b373ee9a85b2f79e187b582379326b7b70d2:/cookbooks/matomo/templates/default/apache.erb diff --git a/cookbooks/matomo/templates/default/apache.erb b/cookbooks/matomo/templates/default/apache.erb index 45b8bc0f3..5fd21d602 100644 --- a/cookbooks/matomo/templates/default/apache.erb +++ b/cookbooks/matomo/templates/default/apache.erb @@ -2,9 +2,6 @@ ServerName matomo.openstreetmap.org - ServerAlias matomo.osm.org - ServerAlias piwik.openstreetmap.org - ServerAlias piwik.osm.org ServerAdmin webmaster@openstreetmap.org SSLEngine on @@ -24,6 +21,22 @@ Redirect 403 /tmp/ + + ServerName matomo.osm.org + ServerAlias piwik.openstreetmap.org + ServerAlias piwik.osm.org + ServerAdmin webmaster@openstreetmap.org + + SSLEngine on + 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 + ErrorLog /var/log/apache2/matomo.openstreetmap.org-error.log + + RedirectPermanent / https://matomo.openstreetmap.org/ + + ServerName matomo.openstreetmap.org ServerAlias matomo.osm.org @@ -44,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"