Using Nginx for load Balancing under Windows platform

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.