Munin setup help
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.
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
@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)"