Nginx builds load balancing process with IIS under Windows

Source: Internet
Author: User

because the project encountered a lot of picture storage problems, although now we do not have a lot of pictures ( currently at 1T , the growth rate is expected to 1.3 times per year ) , thinking about how to effectively store lots of pictures, find some information, see, someone uses Nginx Set up a server, in the spirit of learning, oneself also personally to experience a bit Nginx in the window under the installation process, and with IIS to build a load balancing process, the environment is as follows:

Build Load Balancing process with IIS under Windows >



Explain, because I am a computer, in order to demonstrate the effect, so the virtual machine is installed.

Computer A: installed on this computer Nginx It will also configure IIS , in order not to and Nginx of the the port conflicts, be sure to modify the port number, with the virtual machine B match, equivalent to 2 servers, to do load balancing

Virtual Machines B: simulate a server and build IIS , the port number is used the Port.

Here's a look at the resources that the installation process has used

Virtual Machine Resources:

Thunder Download Address: HTTP://6. Jsdx3.crsky.com/software1/vmwareworkstation-v9.0.1.zip

VM usage Guide Materials : http://open-source.blog.163.com/blog/static/1267734512010714103659611/

Windows Mirrored resources:http://www.jb51.net/os/windows/Win2003/1904.html

Nginx Resources:

Chinese nginx: Http://www.ostools.net/apidocs/apidoc?api=nginx-zh

installation Nginx

1 . after the download is ready, Unzip the file to the directory you specified, not necessarily in C:\ below, I put myself in the

Build load balancing process with IIS under Windows >

Is also possible, that is, at the start, you need to CMD command to navigate to D:\program\nginx directory before you can

Note: I downloaded this version of nginx-1.2.1 , after decompression, the file name nginx-1.2.1 modified to Nginx

2 . before the formal installation, the first configuration, Open the conf/nginx.conf file in the directory

Build Load balancing process with IIS under windows >


And then Modify

will be here the Modified to any port number, I changed here to 8090.

3 . open CMD command line tool, go to the nginx installation directory, I am here D:\program\nginx

then enter the C35>:nginx

enter without any hint that the installation was successful , Browser Input 127.0.0.1: 8090

Even if the success of a small step.

Close Nginx the command for : nginx–s stop

4 . The next step is to configure the server, remember to change the conf/nginx.conf file revert back to avoid confusion when setting back

as I have said before, I will Nginx installed in the 192.168.21.1 on the computer, first configure the above IIStobuild a test site www.nginxtest.com Port is 801

This site is placed under a index.html page

5 . Configure the virtual machine on the IIS , Ibid . , the only difference is that the port number is set to It'll be all right.

6 . modify Nginx The result of the modified configuration file conf/nginx.conf is:

Here is a detailed explanation:

< c29> A area , c38> here the upstream is added, must be added to the server {} before the node configuration

12> c22> This indicates that there are 2 Machine to do load balancing. www.nginxtest.com is my own configured test site

< c45> B area , c54> is configured here is the nginx Monitor port, here is the default configuration port, and nginx Where is the server IP, I'm 192.168.21.1

C region , the domain name to proxy

when the configuration is complete, start again Nginx , there will be a process here. 2 a NGINX

Browser input Address: www.nginxtest.com

A few more refreshes will appear as follows 2 situation, it reached the 2 Day Service Load Balancing effect

A few more refreshes, this will alternately appear. Done!

Related articles:

Detailed description of running and starting in nginx Configuration

The above describes the Nginx in Windows with IIS to build load balancing process, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.