nginx memcache tomcat 集群 负载均衡

首先先了解什么是nginx:

http://cxshun.iteye.com/blog/1535188


 
图片来自其他
 
 
从上图可以了解到整个集群的部署框架
 
安装地址:
http://www.iteye.com/topic/1125301
 
nginx 配置后出现的问题:
js,css,png...等显示不了?
1,查看页面源代码发现:读取js,css,png等信息时,系统去读取了“http://tomcat_service/项目名称/css..."tomcat_service 为配置多个服务器的名称,很显然这样是错误的!
多次搜索了”nginx css,js,png无法显示“却没有得到答案,突然发现:
  1. location / {  
  2. proxy_pass http://tomcat_service
  3. proxy_redirect default;  
  4. proxy_connect_timeout 10; (跟代理服务器连接的超时时间,必须留意这个time out时间不能超过10秒.当一台服务器当掉时,过10秒转发到另外一台服务器)  
  5. }   
 
上面没有添加头格式!如下:
  1.  proxy_set_header  X-Real-IP  $remote_addr;  
  2.  client_max_body_size  100m; 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

posted @ 2014-11-27 17:04  时游  阅读(625)  评论(0编辑  收藏  举报