nginx_反向代理_负载均衡

一个简单的负载均衡案例,很好很强大

 

 

        upstream backend {
                server 127.0.0.1:9011 weight=2 max_fails=3 fail_timeout=30s;
                server 127.0.0.1:9012 weight=2 max_fails=3 fail_timeout=30s;
                }

 

 

        server {
                listen 9000;

                location / {
                        proxy_pass http://backend;
                        proxy_redirect off;
                        proxy_set_header Host $host:9000;
                        proxy_set_header X-Real-IP $remote_addr;
        }
       
       
                location ~ ^/(WEB-INF)/ {
                        deny all;
                }
        }

 

 

 

 

 

你可能感兴趣的:(Linux_nginx)