First demo of the initial knowledge of Nginx

Source: Internet
Author: User

Mall Project did one months, think must use load balance, simple to understand the Nginx, first share the first demo, May after the launch, will continue to share a series of related knowledge.

Under the Nginx root directory, a nginx.bat batch file is used to start and close the Nginx service. If you need a nginx1.9.3, you will be given a package with a batch of files, even if you leave a mailbox.

I respectively in the IP for XXX and XXX server deployed three sites, the first server with 8040 (site1), 8041 Port (site2), the second server with the 8043 (site3) port, Load balancer server with 8088 ports. Three site home are index, the content for me is the site 1, I am site 2, I am the site 3.

Take a look at the configuration file, nginx.conf.

Adding server cluster nodes under the HTTP configuration node

Upstream Site {server xxxxx:8040; server xxxxx:8041;

Server xxxxx:8043}


Then configure the listening port in the server node under HTTP Listen to configure the port of the listener server.

Finally, save the configuration file and restart the Nginx service.

When accessed in the browser, it accesses the port of the Nginx listener server . Nginx will automatically assign us the request, without the Nginx weight is not configured, constantly refresh the page, you will see the index page of three sites constantly switching effect.

Finally share two articles

Nginx configuration file Description

Nginx+iis Load Balancing

First demo of the initial knowledge of Nginx

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.