我这几天做了一个前端是nginx,后端是apache,页面是可以访问了,但是没有加载css和图片,页面显示

顺便也把弄的nginx配置发下,方便大虾帮忙一下哦:
[root@dsvps2012 ~]# vim /usr/local/nginx/conf/vhost/www.giantsjerseys2012.com.conf
log_format www.giantsjerseys2012.com '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen 80;
server_name www.giantsjerseys2012.com giantsjerseys2012.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/giantsj2012com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
include .htaccess.conf;
location / {
proxy_pass http://50.115.42.143:80;
}
location ~* \.(jpg|jpeg|gif|png)$
{
access_log off;
expires 30d;
}
location ~* \.(js|css)$
{
access_log off;
expires 1d;
}
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/www.giantsjerseys2012.com.log www.giantsjerseys2012.com;
}
这个是在/usr/local/nginx/conf/vhost/www.giantsjerseys2012.com.conf添加的。。
不是在/usr/local/nginx/conf/nginx.conf添加的,因为我的vps要弄多个网站。。
希望大神帮忙解决一下哦。。谢谢了。。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
location 里面指定 root 目录就行了。######回复 @新世纪IT民工 : 不是 你的样式出不来 就在样式那个 location 里面 加上 root 你存放样式的路径;######你是说在root那边把/home/wwwroot/giantsjersey2012com/改成apache里面那边的存放文件的路径吗???######样式不显示无外乎就是样式 404了呗,看下你的路径咯。######嗯嗯。。是路径出问题了。。没找到,我加了路径就可以了。。######location ~* .(js|css)$
{ root /home/wwwroot/giantsj2012com/css #这里设置css的路径 access_log off; expires 1d; }
其他的类似 ######@新世纪IT民工 在别的服务器上的路径,没试过。本地是这样配的。######是的。。你那个路径要是不同的服务器可以吗?