]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/matomo/templates/default/apache.erb
supybot: osmosis now uses main branch
[chef.git] / cookbooks / matomo / templates / default / apache.erb
index 589d563d6ceb01826448224b607f12e410630c0f..525d1fbccb83fd669fa49c20613dd0f13b1293f8 100644 (file)
@@ -8,7 +8,7 @@
        SSLCertificateFile /etc/ssl/certs/matomo.openstreetmap.org.pem
        SSLCertificateKeyFile /etc/ssl/private/matomo.openstreetmap.org.key
 
        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
        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
 
        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/
        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
 
        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/
        ErrorLog /var/log/apache2/matomo.openstreetmap.org-error.log
 
        RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
        ExpiresActive On
        RewriteEngine on
 
        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]
 
        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]
+
+       <FilesMatch "\.js\.br$">
+               Header append Content-Encoding br
+               Header append Vary Accept-Encoding
+       </FilesMatch>
 
        <FilesMatch "\.js\.gz$">
                Header append Content-Encoding gzip
                Header append Vary Accept-Encoding
        </FilesMatch>
 
 
        <FilesMatch "\.js\.gz$">
                Header append Content-Encoding gzip
                Header append Vary Accept-Encoding
        </FilesMatch>
 
-       <FilesMatch "(\.js|\.js\.gz)$">
+       <FilesMatch "(\.js|\.js\.gz|\.js\.br)$">
                ExpiresDefault "access plus 1 week"
                Header set Cache-Control "max-age=604800"
        </FilesMatch>
 
         <FilesMatch ".+\.ph(ar|p|tml)$">
                ExpiresDefault "access plus 1 week"
                Header set Cache-Control "max-age=604800"
        </FilesMatch>
 
         <FilesMatch ".+\.ph(ar|p|tml)$">
-                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"
         </FilesMatch>
 </Directory>
         </FilesMatch>
 </Directory>