nginx reverse proxy --upstream module

WBOY
Release: 2016-07-29 09:01:38
Original
1511 people have browsed it

1.nginx load balancing relies on the ngx_http_upstream_module module and supports the following proxy modes:

proxy_pass: generally used for reverse proxy

fastcgi_pass: generally used for interacting with dynamic files, php, etc.

memcached_pass:

2.upstream module Write

upsrtream module name {

server abc.example.com weight=5;

You can connect domain name or ip, if you don’t add the port number, the default is 80, weight is the weight, the larger the value, the higher the weight

server abc .com:8080;

Server unix:/tmp/backend3;

Specify the socket file

}

3. Upstream module related instructions

1) It should be placed in the http tag of the configuration file

2) Upstream default algorithm It is wrr (weighted polling)

3) content-related parameters

max_fails maximum number of attempts, number of times to connect to the realserver behind

backup hot backup configuration, enable backup when all activated realservers fail

fail_timeout failure timeout, in conjunction with the above max_fails, after checking n times, wait n seconds

down the server is unavailable, use it with ip_hash

The above introduces the nginx reverse proxy-upstream module, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!