nginx 位置路径问题

Mic*_*rys 4 nginx debian-squeeze

我在我的 nginx 中的 debian 挤压上有一个几乎默认启用站点的设置,我现在正试图让它在 myhost/munin/ 上提供我的 munin 图表

这是我添加到配置中的位置

       location /munin
            {
                    root /var/cache/munin/www/;
                    index index.htm index.html;
            }
Run Code Online (Sandbox Code Playgroud)

这是我收到的错误:

            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: ""
Run Code Online (Sandbox Code Playgroud)

此设置用于在 apache 中“正常工作”。我是 nginx 的新手,所以对于为什么在寻找路径时添加额外的 /munin 有点迷茫。有什么建议吗?

Mic*_*ton 7

您需要使用该alias指令,而不是root

location /munin/ {
    alias /var/cache/munin/www/;
}
Run Code Online (Sandbox Code Playgroud)