Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a pretty much default sites-enabled set up in my nginx on debian squeeze and i'm now trying to get it to serve up my munin graphs on myhost/munin/

Heres the location i've added to the config

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

And here is the error I recieve:

            2012/07/09 23:52:03 [error] 3598#0: *13 "/var/cache/munin/www/munin/index.htm" is not found (2: No such file or directory), client: 93.*.*.*, server: , request: "GET /munin/ HTTP/1.1", host: ""

This set up used to 'just work' in apache. I'm new to nginx so a bit lost as to why its adding the extra /munin when looking for the path. Any advice?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

You need to use the alias directive, rather than root:

location /munin/ {
    alias /var/cache/munin/www/;
}
share|improve this answer
    
Perfect, Thank you so much! –  Michael Jefferys Jul 10 '12 at 6:10
add comment

Try this

root /var/cache/munin/www/;

location /
            {

                    index index.htm index.html;
            }

Whats going on here (for dummies mode, no offence):

First we are telling nginx where the DocRoot is, which is /var/.... meaning all future "location" refer to path under this.

then location is simply referencing the top "/" path of this directory

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.