Munin / Nginx – Nginx尽pipe使用别名指定了不同的path,但预先考虑了根文件path

我已经安装了munin(暂时可用: http : //brailsford.xyz/munin ),问题是从/ var / cache / munin / www的核心加载 – 无静态文件加载。

我在我的nginxconfiguration中有以下内容:

location /munin/static/ { alias /etc/munin/static/; expires modified +1w; autoindex on; } location /munin/ { #auth_basic "Restricted"; # Create the htpasswd file with the htpasswd tool. #auth_basic_user_file /etc/nginx/htpasswd; alias /var/cache/munin/www/; expires modified +310s; } 

AutoIndex有一个certificate:该文件夹是可访问的: https ://brailsford.xyz/munin/static/

但是,单击该文件夹中的文件会给出404,而nginx错误日志显示了这一点:

 [error] 22570#0: *50 open() "/data/www/brailsford.xyz/munin/static/style-new.css" failed (2: No such file or directory) 

/data/www/brailsford.xyz是在整个服务器子句中指定的根。

任何build议将不胜感激 :)

编辑1:

  location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff)$ { expires 1w; } 

对于任何以.css结尾的URI, location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff)$ block优先,这意味着nginx尝试为root使用错误的值。

使用前缀location上的^~修饰符使其优先于任何正则expression式位置。

例如:

 location ^~ /munin/static/ { ... } 

这假设该位置没有任何特殊的内容,如.php文件。

详情请参阅此文件 。