Blob Blame History Raw
# Example configuration for nginx with cgi generated graphs.
#
# To use this example config file you need to enable cgi graphs in Munin. Add
# following three lines to /etc/munin/conf.d/local.conf (without # character):
#
#   graph_strategy cgi
#   html_strategy cgi
#   cgiurl_graph /munin/graph
#
# Then copy this file to /etc/nginx/conf.d/ directory and restart nginx.
# Services munin-cgi-html and munin-cgi-graph must also be started:
#
#   systemctl enable --now munin-cgi-html.socket munin-cgi-graph.socket
#
# Access Munin at http://localhost/munin/


server {
    listen      80;
    server_name localhost;
    root        /usr/share/nginx/html;

    location /munin/static/ {
        alias   /etc/munin/static/;
    }

    location /munin/graph/ {
        include                 fastcgi_params;
        fastcgi_split_path_info ^(/munin/graph)(.*);
        fastcgi_param           PATH_INFO $fastcgi_path_info;
        fastcgi_pass            unix:/var/run/munin/munin-cgi-graph.sock;
    }

    location /munin/ {
        include                 fastcgi_params;
        fastcgi_split_path_info ^(/munin)(.*);
        fastcgi_param           PATH_INFO $fastcgi_path_info;
        fastcgi_pass            unix:/var/run/munin/munin-cgi-html.sock;
    }
}