uwsgi_cache_lock_timeout

Syntax: uwsgi_cache_lock_timeout time; Default: uwsgi_cache_lock_timeout 5s; Context: http, server, location This directive appeared in version 1.1.12. Sets a timeout for uwsgi_cache_lock. When the time expires, the request will be passed to the uwsgi server, however, the response will not be cached. Before 1.7.8, the response could be cached.

uwsgi_cache_lock_age

Syntax: uwsgi_cache_lock_age time; Default: uwsgi_cache_lock_age 5s; Context: http, server, location This directive appeared in version 1.7.8. If the last request passed to the uwsgi server for populating a new cache element has not completed for the specified time, one more request may be passed to the uwsgi server.

uwsgi_cache_key

Syntax: uwsgi_cache_key string; Default: — Context: http, server, location Defines a key for caching, for example uwsgi_cache_key localhost:9000$request_uri;

uwsgi_cache_bypass

Syntax: uwsgi_cache_bypass string ...; Default: — Context: http, server, location Defines conditions under which the response will not be taken from a cache. If at least one value of the string parameters is not empty and is not equal to “0” then the response will not be taken from the cache: uwsgi_cache_bypass $cookie_nocache $arg_nocache$arg_comment; uwsgi_cache_bypass $http_pragma $http_authorization; Can be used along with the uwsgi_no_cache directive.

uwsgi_buffer_size

Syntax: uwsgi_buffer_size size; Default: uwsgi_buffer_size 4k|8k; Context: http, server, location Sets the size of the buffer used for reading the first part of the response received from the uwsgi server. This part usually contains a small response header. By default, the buffer size is equal to one memory page. This is either 4K or 8K, depending on a platform. It can be made smaller, however.

uwsgi_cache

Syntax: uwsgi_cache zone | off; Default: uwsgi_cache off; Context: http, server, location Defines a shared memory zone used for caching. The same zone can be used in several places. Parameter value can contain variables (1.7.9). The off parameter disables caching inherited from the previous configuration level.

uwsgi_busy_buffers_size

Syntax: uwsgi_busy_buffers_size size; Default: uwsgi_busy_buffers_size 8k|16k; Context: http, server, location When buffering of responses from the uwsgi server is enabled, limits the total size of buffers that can be busy sending a response to the client while the response is not yet fully read. In the meantime, the rest of the buffers can be used for reading the response and, if needed, buffering part of the response to a temporary file. By default, size is limited by the size of

uwsgi_buffers

Syntax: uwsgi_buffers number size; Default: uwsgi_buffers 8 4k|8k; Context: http, server, location Sets the number and size of the buffers used for reading a response from the uwsgi server, for a single connection. By default, the buffer size is equal to one memory page. This is either 4K or 8K, depending on a platform.

uwsgi_buffering

Syntax: uwsgi_buffering on | off; Default: uwsgi_buffering on; Context: http, server, location Enables or disables buffering of responses from the uwsgi server. When buffering is enabled, nginx receives a response from the uwsgi server as soon as possible, saving it into the buffers set by the uwsgi_buffer_size and uwsgi_buffers directives. If the whole response does not fit into memory, a part of it can be saved to a temporary file on the disk. Writing to temporary files is cont

Using nginx as HTTP load balancer

Using nginx as HTTP load balancer Load balancing methods Default load balancing configuration Least connected load balancing Session persistence Weighted load balancing Health checks Further reading