免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2809 | 回复: 0
打印 上一主题 下一主题

nginx squid 双机动静分离问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-04-15 15:40 |只看该作者 |倒序浏览
现有一台squid 服务器  一台nginx
想实现动静分离   图片、css 、js 访问squid   
动态的请求访问nginx  应该怎么配置   给个思路

这样配置出现了错误


192.168.118.128   为squid      squid 的源 192.168.118.130
squid配置:

cache_peer 192.168.118.130  parent 80 0 no-query no-digest originserver name=a
cache_peer_domain a parent  .spark.com   www.spark.com
http_access allow  all
cache_peer_access a allow all


192.168.118.130   为ngnix服务

www.spark.com 解析到192.168.118.130  

配置
   upstream php{
                server 192.168.118.130 weight=4 max_fails=2 fail_timeout=30s;              

}
        upstream squid {
                server 192.168.118.128:80 weight=1 max_fails=2 fail_timeout=30s;
               

}

  server
      {
     listen       80;
     server_name www.spark.com;
     index  index.html index.htm index.php;
     root /data0/htdocs/www/bbs ;

     #limit_conn   crawler  20;

location /
    {
       proxy_pass http://php;
       proxy_set_header Host   $host;
       proxy_set_header X-Forwarded-For $remote_addr;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$
   # location /images/
    {
       proxy_pass http://squid;
       proxy_set_header Host   $host;
       proxy_set_header X-Forwarded-For $remote_addr;
    }

出现的问题是 当访问 squid 会出现deny allow 错误。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP