Munin setup help

Trying to get munin working at http://myip/munin but I'm getting a 404. Currently, I have several virtual hosts setup and working fine, so I added a "default" config file in sites-available with the following:

server {
    server_name myIP (removed);
    access_log /srv/www/default/logs/access.log;
    error_log /srv/www/default/logs/error.log;
    root /srv/www/default/public_html;

    location / {
        index index.html index.htm index.php;
    }

    # serve static files directly
        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
            access_log        off;
            expires           30d;
    }

    location ~ \.php$ {
    try_files $uri =404;
        include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/var/run/php5-fpm/defaultsite.socket;
        fastcgi_index index.php;
    }

    # path to munin files
    location /munin/ {
          alias /var/cache/munin/www/;
    }

}

I wasn't using a default site before so I set one up and it serves pages out of the publichtml folder fine, it is just the munin alias I'm having trouble with. The code above is basically the same I'm using in the other sites with the change of the servername and the munin location block.

http://IP shows index.html I put in there and http://IP/munin shows 404.

It appears that since I'm setting the root up top, the alias isn't going to work with that root already being set. Any way I can get this working?

2 Replies

Looks like you're missing the / off the end of the url it should be http://ip/munin/

@obs:

Looks like you're missing the / off the end of the url it should be http://ip/munin/

Still gives me 404.

Error log shows like it isn't even reading the alias location block.

2013/06/23 08:23:20 [error] 20745#0: *58120 open() "/srv/www/default/public_html/munin" failed (2: No such file or directory), client: (IP here), server: (IP here), request: "GET /munin HTTP/1.1", host: "(IP here)"
2013/06/23 08:23:50 [error] 20742#0: *58172 open() "/srv/www/default/public_html/munin/index.html" failed (2: No such file or directory), client: (IP here), server: (IP here), request: "GET /munin/ HTTP/1.1", host: "(IP here)"

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct