Skip to content

Instantly share code, notes, and snippets.

@L-P
Created October 10, 2016 15:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save L-P/f7871e44bbf4a6fd4c0ff6a65ef35d3d to your computer and use it in GitHub Desktop.
Save L-P/f7871e44bbf4a6fd4c0ff6a65ef35d3d to your computer and use it in GitHub Desktop.
Munin dynazoom graphs with nginx and spawn-fcgi
[Unit]
Description=Munin FCGI
After=network.target
[Service]
Type=forking
PIDFile=/var/run/munin/fcgi-graph.pid
Restart=always
ExecStartPre=/bin/mkdir -p /var/lib/munin/cgi-tmp/munin-cgi-graph
ExecStartPre=/bin/chown www-data:munin /var/lib/munin/cgi-tmp/munin-cgi-graph
ExecStart=/usr/bin/spawn-fcgi \
-s /var/run/munin/fcgi-graph.sock \
-P /var/run/munin/fcgi-graph.pid \
-U www-data -u www-data -g munin -M 0660 \
-- /usr/lib/munin/cgi/munin-cgi-graph
[Install]
WantedBy=multi-user.target
location ^~ /munin-cgi/munin-cgi-graph/ {
fastcgi_split_path_info ^(/munin-cgi/munin-cgi-graph)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/munin/fcgi-graph.sock;
include fastcgi_params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment