NginX & Munin - Location and error 404

Posted by user1684189 on Server Fault See other posts from Server Fault or by user1684189
Published on 2012-11-22T10:03:17Z Indexed on 2012/11/22 11:04 UTC
Read the original article Hit count: 238

Filed under:
|
|

I've a server that running nginx+php-fpm with this simple configuration:

server {
    listen   80;
    server_name ipoftheserver;
    access_log /var/www/default/logs/access.log;
    error_log /var/www/default/logs/error.log;

    location / {
        root   /var/www/default/public_html;
        index  index.html index.htm index.php;
    }


    location ^~ /munin/ {
        root /var/cache/munin/www/;
        index index.html index.htm index.php;
    }

    location ~\.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/default/public_html$fastcgi_script_name;
    }
}

but when I open ipoftheserver/munin/ I recieve a 404 error (when I request ipoftheserver/ the files on /var/www/default/public_html are listened correctly)

Munin is installed and works perfectly. If I remove this configuration and I use this another one all works good (but not in the /munin/ directory):

server {
  server_name ipoftheserver;
  root /var/cache/munin/www/;
  location / {
    index index.html;
    access_log off;
  }
}

How to fix? Many thanks for your help

© Server Fault or respective owner

Related posts about nginx

Related posts about munin