你好我所有的我的Nginx前端+ Apache2后端+ PHPBB3软件有问题。 它不会加载CSS和图像。 我得到这样的不断的错误:
2010/04/14 16:57:25 [error] 13365#0:* 69 open()“/var/www/foo/styles/styles/coffee_time/theme/large.css”failed(2:No such file or目录),客户端:83.44.175.237,服务器:www.foo.com,请求:“GET /styles/coffee_time/theme/large.css HTTP / 1.1”,主机:“www.foo.com”,referrer:“ http ://www.foo.com/viewforum.php?f = 43 “
这是我的网站configuration:
服务器{听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/; }
我解决了这个问题。 这是有点小白的问题,错误的path:)