Back to Tengine

Name #

docs/modules/ngx_limit_upstream.md

3.1.01.7 KB
Original Source

Name

limit upstream retries

Limits retries for upstream servers (proxy, memcached, fastcgi, scgi, uwsgi). Using one of the directives below will enable this feature.

Example

http {
    upstream test {
        server 127.0.0.1:8081;
        server 127.0.0.2:8081;
        server 127.0.0.3:8081;
        server 127.0.0.4:8081;
    }

    server {
        proxy_upstream_tries 2;
        proxy_set_header Host $host;

        location / {
            proxy_pass test;
        }
    }
}

Directives

fastcgi_upstream_tries

Syntax: fastcgi_upstream_tries num

Default: -

Context: http, server, locatioon

Limit the maximum number of tries for fastcgi proxy. Nginx tries to connect different server each time.

proxy_upstream_tries

Syntax: proxy_upstream_tries num

Default: -

Context: http, server, locatioon

Limit the maximum number of tries for http proxy. Nginx tries to connect different server each time.

memcached_upstream_tries

Syntax: memcached_upstream_tries num

Default: -

Context: http, server, locatioon

Limit the maximum number of tries for memcached proxy. Nginx tries to connect different server each time.

scgi_upstream_tries

Syntax: scgi_upstream_tries num

Default: -

Context: http, server, locatioon

Limit the maximum number of tries for scgi proxy. Nginx tries to connect different server each time.

uwsgi_upstream_tries

Syntax: uwsgi_upstream_tries num

Default: -

Context: http, server, locatioon

Limit the maximum number of tries for uwsgi proxy. Nginx tries to connect different server each time.