From f5c46dbd0dc40c54987058b0a0b312add8419c4e Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Wed, 21 Aug 2024 20:26:51 +0200 Subject: [PATCH] dd --- roles/mgrote_munin_server/templates/apache.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/roles/mgrote_munin_server/templates/apache.conf b/roles/mgrote_munin_server/templates/apache.conf index 3cd3b2f3..c883f2c0 100644 --- a/roles/mgrote_munin_server/templates/apache.conf +++ b/roles/mgrote_munin_server/templates/apache.conf @@ -1,6 +1,19 @@ ServerName {{ munin_servername }} + DocumentRoot /var/www + + # Rewrite rules to serve traffic from the root instead of /munin-cgi + RewriteEngine On + # Static files + RewriteRule ^/favicon.ico /var/cache/munin/www/static/favicon.ico [L] + RewriteRule ^/static/(.*) /var/cache/munin/www/static/$1 [L] + # HTML + RewriteRule ^(/.*\.html)?$ /munin-cgi/munin-cgi-html/$1 [PT] + # Images + RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1 + RewriteCond %{REQUEST_URI} !^/static + RewriteRule ^/(.*.png)$ /munin-cgi/munin-cgi-graph/$1 [L,PT] ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html