munin-monitoring / munin

Main repository for munin master / node / plugins
http://munin-monitoring.org
Other
2k stars 474 forks source link

Caddy Version 2 Support on Ubuntu 22.04? #1569

Open war59312 opened 1 year ago

war59312 commented 1 year ago

Hi,

Has anyone gotten Munin working with Caddy Version 2 on Ubuntu 22.04?

Be great if could get an example on https://guide.munin-monitoring.org/en/latest/example/index.html

munin.domain.com {
    root * /var/cache/munin/www
    file_server /*
}

That at least gets the basic pages working.

Have NOT gotten the CGI pages/images to work.

That is https://munin.domain.com/munin-cgi/

Best,

Will

AndCycle commented 4 months ago

here is mine setting, my munin cgi spawn socks by spawn-fcgi

munin.example.com {

    ### !!! match munin.conf cgiurl_graph setting for path "/munin-cgi/munin-cgi-graph" !!! ###

    @cgiurl_graph expression {http.request.orig_uri.path.dir}.startsWith("/munin-cgi/munin-cgi-graph")

    handle_path /static/* {
        root * /etc/munin/static
        file_server
    }

    handle @cgiurl_graph {
        reverse_proxy  unix//run/munin-cgi-graph.sock {
            transport fastcgi {
                split /munin-cgi/munin-cgi-graph
            }
        }
    }

    handle {
        reverse_proxy  unix//run/munin-cgi-html.sock {
            transport fastcgi
        }
    }
}
war59312 commented 4 months ago

Thanks for sharing.

Sadly munin subdomain gives a HTTP ERROR 502 using that config.

If I comment out that last handle, most pages just show white page and view source is empty.

/static/dynazoom.html?cgiurl_graph page loads but still no images.

At the moment I am using:

munin.domain.com {
    root * /var/cache/munin/www
    file_server /*
    php_fastcgi 127.0.0.1:9000
    php_fastcgi /usr/lib/munin/cgi/munin-cgi-graph/ /var/run/munin/fcgi-graph.sock {
        split ^(/usr/lib/munin/cgi/munin-cgi-graph)(.*)
    }
    php_fastcgi /usr/lib/munin/cgi/munin-cgi-html/ /var/run/munin/fcgi-html.sock {
         split ^(/usr/lib/munin/cgi/munin-cgi-html)(.*)
    }
    handle /munin-cgi/* {
        root * /usr/lib/munin/cgi
        file_server /*
    }
    encode zstd gzip
}

munin.domain.com/munin-cgi {
    root * /usr/lib/munin
    file_server /*
}

Everything but the images on https://munin.domain.com/static/dynazoom.html work with above.