大家好,我的 Nginx Frontend + Apache2 Backend + PHPBB3 软件出现了问题。它无法加载 CSS 和图像。我不断收到如下错误:
2010/04/14 16:57:25 [错误] 13365#0:*69 open()“/var/www/foo/styles/styles/coffee_time/theme/large.css”失败(2:没有此文件或目录),客户端:83.44.175.237,服务器:www.foo.com,请求:“GET /styles/coffee_time/theme/large.css HTTP/1.1”,主机:“www.foo.com”,引荐来源:“http://www.foo.com/viewforum.php?f=43“
这是我的网站配置:
服务器{监听80;服务器名称www.foo.com;访问日志/var/log/nginx/foo.access.log;
# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires 30d;
root /var/www/foo/;
}
location / {
root /var/www/foo/;
index /var/www/foo/index.php;
}
# proxy the PHP scripts to predefined upstream .apache. #
location ~ .php$ {
proxy_pass http://apache;
}
location /styles/ {
root /var/www/foo/styles/;
}
答案1
我修复了这个问题。这是一个小问题,路径错误 :)