HTTP directives

queue directive (HTTP)

Bound pending requests awaiting a selectable upstream peer. No default queue; timeout defaults to 60 seconds when configured. Full queue or elapsed wait returns 502. Context upstream. Choose a capacity and wait budget together; an alternative balancing method must precede queue. Version: 1.5.12. Commercial subscription; not a general application job queue. Example: partial http configuration for a disposable synthetic lab; not a complete deployment.

Formal Syntax & Structure

nginx syntaxnginx
queue number [timeout=time];

Parameters & Attributes

NameTypeDescription
numberpositive integerMaximum pending requests.
timeouttimeout=durationWait budget for peer selection; default 60s.

Working Example

Example Snippetnginx
upstream lab_queue {    zone lab_queue_zone 64k;    server 127.0.0.1:19881 max_conns=2;    queue 4 timeout=2s;}
Nginx Reference