nginx负载均衡配置

worker_processes 1; 
events { 
worker_connections 1024; 

http{
#这里指定多个源服务器,ip:端口,如果是80默认端口,可写可不写 。此处可以写同一台节点的多个端口作为负载,也可以写多个节点作为负载 
upstream www.benet.com
server 192.168.43.158:80; 
server 192.168.41.167:80; 

server { 
listen 8080; 

server_name www.benet.com;
location / { 
proxy_pass
http://www.benet.com

proxy_set_header   Host             $host;
proxy_set_header   X-Real-IP        $remote_addr;
proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;


}

你可能感兴趣的:(nginx,centos5.5)