37236c4
# Example configuration for nginx with cgi generated graphs.
37236c4
#
37236c4
# To use this example config file you need to enable cgi graphs in Munin. Add
37236c4
# following three lines to /etc/munin/conf.d/local.conf (without # character):
5c2cefb
#
37236c4
#   graph_strategy cgi
37236c4
#   html_strategy cgi
37236c4
#   cgiurl_graph /munin/graph
5c2cefb
#
37236c4
# Then copy this file to /etc/nginx/conf.d/ directory and restart nginx.
8793e82
# Services munin-cgi-html and munin-cgi-graph must also be started:
8793e82
#
8793e82
#   systemctl enable --now munin-cgi-html.socket munin-cgi-graph.socket
37236c4
#
37236c4
# Access Munin at http://localhost/munin/
4f306b1
4f306b1
5c2cefb
server {
5c2cefb
    listen      80;
5c2cefb
    server_name localhost;
5c2cefb
    root        /usr/share/nginx/html;
4f306b1
5c2cefb
    location /munin/static/ {
5c2cefb
        alias   /etc/munin/static/;
4f306b1
    }
4f306b1
5c2cefb
    location /munin/graph/ {
5c2cefb
        include                 fastcgi_params;
5c2cefb
        fastcgi_split_path_info ^(/munin/graph)(.*);
5c2cefb
        fastcgi_param           PATH_INFO $fastcgi_path_info;
5c2cefb
        fastcgi_pass            unix:/var/run/munin/munin-cgi-graph.sock;
4f306b1
    }
4f306b1
4f306b1
    location /munin/ {
5c2cefb
        include                 fastcgi_params;
4f306b1
        fastcgi_split_path_info ^(/munin)(.*);
5c2cefb
        fastcgi_param           PATH_INFO $fastcgi_path_info;
5c2cefb
        fastcgi_pass            unix:/var/run/munin/munin-cgi-html.sock;
4f306b1
    }
4f306b1
}