Mastering Nginx

(Ron) #1

Directive Reference


[ 244 ]

Directive Explanation Context/Default
proxy_cache_min_
uses

The number of requests for a
certain key needed before a
response is cached.

Valid contexts: http,
server, location
Default value: 1
proxy_cache_path Refer to the Proxy module caching
directives table in the Caching
section in Chapter 5, Reverse Proxy
Advanced Topics.

Valid context: http
Default value: -

proxy_cache_use_
stale

The cases under which it is
acceptable to serve stale cached
data when an error occurs when
accessing the upstream server. The
updating parameter indicates
the case when fresh data are being
loaded.

Valid contexts: http,
server, location
Default value: off

proxy_cache_valid Indicates the length of time for
which a cached response with
response code 200, 301, or 302 is
valid. If an optional response code
is given before the time parameter,
that time is only for that response
code. The special parameter any
indicates that any response code
should be cached for that length
of time.

Valid contexts: http,
server, location
Default value: -

proxy_connect_
timeout

The maximum amount of time
NGINX will wait for its connection
to be accepted when making a
request to an upstream server.

Valid contexts: http,
server, location
Default value: 60s

proxy_cookie_domain Replaces the domain attribute of
the Set-Cookie header from the
upstream server; the domain to be
replaced can either be a string or a
regular expression, or reference a
variable.

Valid contexts: http,
server, location
Default value: off
Free download pdf