Use Nginx Server Load balancer with reverse proxy

Source: Internet
Author: User
Tags nginx server

Use Nginx Server Load balancer with reverse proxy
Set it in the http segment: www.2cto.com upstream my_server_pool {
Server 192.168.10.21: 80 weight = 1 max_fails = 2 fail_timeout = 30 s;
Server 192.168.10.20: 80 weight = 1 max_fails = 2 fail_timeout = 30 s;
Proxy_cache_path/usr/local/nginx/proxy_temp levels = keys_zone = cache_one: 500 m inactive = 1d max_size = 1g;
Set in the server segment: www.2cto.com

Location/sms {
Proxy_pass http: // my_server_pool;
Proxy_set_header Host $ host;
Proxy_cache cache_one;
Proxy_set_header X-Forwarded-For $ remote_addr;
Proxy_cache_valid 200 10 m;
Proxy_cache_valid 304 1 MB;
Proxy_cache_valid 301 302 1 h;
Proxy_cache_valid any 1 m;
Proxy_cache_key $ host $ uri $ is_args $ args;} test:

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.