Because the project encountered a lot of picture storage problems, although now we do not have a lot of pictures (currently at 1T, estimated growth rate of 1.3 times times per year ), their own in thinking how to effectively store a large number of pictures, find some information, see, someone use Nginx set up the server, in the spirit of learning, oneself also personally to experience the installation process of nginx under window, and with IIS to build a load balancing process, the environment is as follows:
Explain, because I am a computer, in order to demonstrate the effect, so the virtual machine is installed.
Computer A: The installation of Nginx on this computer will also configure IIS, in order to not and Nginx 80 port conflict, it is important to modify the port number, with virtual machine B, equivalent to 2 servers, to do load balancing
Virtual Machine B: Simulates a server, establishes IIS, and uses port number 80.
Here's a look at the resources that the installation process has used
Virtual Machine Resources:
Thunderbolt:http://6.jsdx3.crsky.com/software1/VMwareworkstation-v9.0.1.zip
VM Usage Guide Material : http://open-source.blog.163.com/blog/static/1267734512010714103659611/
Windows Mirroring 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 downloading, unzip the file to the directory you specified, not necessarily in C:\ Below, I put myself in the
is also possible, that is, at startup, you need to locate the cmd command in the D:\program\nginx directory to
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, first configure, open the directory of the conf/nginx.conf file
And then Modify
Change the 80 here to any port number, and I'll change it here to 8090.
3. Open CMD command line tool and go to nginx installation directory, I am D:\program\nginx
Then type : Nginx
Enter, without any hint, stating that the installation was successful , the browser input 127.0.0.1:8090
even if the success of a small step.
the command to close Nginx is: nginx–s stop
4. The next step is to configure the server, remember to restore the conf/nginx.conf file that you just modified , to avoid confusion after setting
As I said earlier, I installed the Nginx on the 192.168.21.1 computer, first to configure the above IIS, to establish a test site www.nginxtest.com Port is 801
A index.html page is placed below this site.
5. Configure IIS on the virtual machine, as above , the only difference is that the port number is set to 80.
6. Modify nginx configuration file conf/nginx.conf The modified result is:
Here is a detailed explanation:
Zone A, where the upstream is added and must be added before the server {} node is configured
This means that there are 2 machines to do load balancing. www.nginxtest.com is my own configured test site
b area, here is the nginx monitoring port, here is the default configuration 80 port, and the nginx server IP, I here is 192.168.21.1
C Zone, the domain name to be proxied
After the configuration is complete, start nginx again, there will be 2 nginx in the process.
Browser input address: www.nginxtest.com
A few more refreshes will appear in the following 2 scenarios, the 2-day Service load Balancing effect is achieved
A few more refreshes, this will alternately appear. Done!
Nginx to build load balancing process with IIS under Windows [go]