1. Download the Nginx (http://nginx.org/en/download.html) installation package, unzip it, and use the cmd command to go to the directory where the Nginx.exe is located
2. Execute cmd command start nginx service
3. Deploy 3 sites (in any number) on IIS with IP addresses:
192.168.199.104:8081
192.168.199.104:8082
192.168.199.104:8083
4. Configure nginx.conf
#服务器的集群 upstream netitcast.com {#服务器集群名字 #server172.16.21.13:8081weight=1, #服务器配置 weight is the weight, the larger the weight, the greater the probability of distribution. #server192.168.1.186:8081weight=1; Server172.16.1.14:8081weight=2; Server172.16.1.15:8081weight=1; #server172.16.1.15: theweight=1; } #当前的Nginx的配置 Server {Listen the#监听80端口, can be changed to another port server_name localhost;############## the domain name of the current service #charset koi8-R; #access_log logs/Host.access.log Main; #location/{# root HTML; # index index.html index.htm; #} Location/{proxy_pass http://netitcast.com;Proxy_redirectdefault; }
5. Reload the configuration with the cmd command: nginx-s Reload
6. Run 192.168.199.104 can view the real site each visit by implementing a preset different homepage
7. Use the cmd command to close the Nginx service: nginx-s stop
Using Nginx for load Balancing under Windows platform