RHEL7 down Nginx Load Balancing Configuration
in the first two sections of the installation and configuration files, here write the configuration file, you can modify the configuration file according to the content.
http {
upstream myserver{
Server 192.168.1.21:80 weight=2 max_fails=3 fail_timeout=20s;
Server 192.168.1.22:80 weight=3 max_fails=3 fail_timeout=20s;
Server 192.168.1.23:80 weight=4 max_fails=3 fail_timeout=20s;
}
server{
Listen ;
server_name 192.168.1.20;
index index.htm index.html;
root /application/nginx/html/
Location/{
Proxy_pass http://MyServer ;
Prox_next_upstream http_500 http_502 http_503 error Timeo UT invalid_header;
Proxy_redirect off;
Proxy_set_header Host $host;
Proxy_set_header x-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Client_body_buffer_size 128k;
Proxy_connect_timeout 60s;
Proxy_send_timeout 60s;
Proxy_read_timeout 60s;
Proxy_buffer_size 4k;
Proxy_buffers 4 32k;
Proxy_busy_buffers_size 64k;
Proxy_temp_file_write_size 64k;
}
}
}
This article is from "Flying with the Wind" blog, please be sure to keep this source http://wjb10000.blog.51cto.com/9702295/1792555
RHEL7 Load Balancer Configuration (iv)