大家好,我的 Nginx 前端 + Apache2 后端 + 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;server_name www.foo.com; access_log /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/;
}
我解决了这个问题。这是一个菜鸟问题,错误的路径:)