upstrand

The `upstrand` directive creates a block for constructing combined upstreams in NGINX.

Syntaxupstrand { ... }
Defaultnone
Contexthttp
Argumentsblock (1)

Description

The upstrand directive, part of the NGINX Combined Upstreams module, enables the creation of a super-layer of upstreams, facilitating flexible management of multiple upstream groups. This Directive is crucial for optimizing load balancing in complex architectures where upstream servers need to be organized logically into groups.

Being defined within the HTTP context, the upstrand directive acts as a block that encapsulates other upstream directives and configurations. The block can include other directives, helping define the behavior of upstream servers, such as defining which upstreams to combine and how they interact. It enhances efficiency by allowing administrators to configure multiple upstream server groups in a streamlined manner, all under a single logical structure.

The directive can serve as a foundation for further custom configurations, such as dynamic selection of upstreams during runtime, which can enhance performance and maintainability through better resource usage and reduced complex configurations. When deploying this directive, users should ensure proper nesting and adhere to the contextual rules defined in the NGINX directives documentation to avoid misconfigurations.

Config Example

upstrand {
    add_upstream upstream1;
    add_upstream upstream2 weight=2;
}

Ensure that the upstrand block is properly nested within the HTTP context.

Avoid defining upstrand directives in locations other than the HTTP context to prevent configuration errors.

Remember to specify proper upstream names while using add_upstream within the upstrand block.

← Back to all directives