Nginx负载均衡实例

时间:2024-08-03 08:06:31
upstream MyServers{
server 192.168.63.137;
server 192.168.63.138;
server 192.168.63.140;
}
server{

listen 80 default_server;

listen [::]:80 default_server ipv6only=on;

#root /usr/share/nginx/html;

#index index.html index.htm;

   # Make site accessible from http://localhost/

server_name localhost;

     location /{ 

root html;

         index index.html;

       proxy_pass http://MyServers;

     }

 }