Mastering Nginx

(Ron) #1
Chapter 4

[ 71 ]


  • The proxy_read_timeout and proxy_send_timeout directives define
    how long NGINX will wait between successive operations with the
    upstream server.

  • The proxy_send_lowat directive is only effective on FreeBSD systems
    and specifies the number of bytes the socket send buffer should hold
    before passing the data on to the protocol.

  • The proxy_buffer_size, proxy_buffers, and proxy_busy_buffers_size
    directives will be discussed in detail in the next chapter. Suffice it to say
    that these buffers control how quickly NGINX appears to respond to
    user requests.

  • The proxy_temp_file_write_size directive controls how long a worker
    process blocks while spooling data: the higher the value, the longer the
    process blocks.


These directives are included in a file as follows, and may be used multiple times


in the same configuration:


location / {

include proxy.conf;

proxy_pass http://localhost:8080;
}

If one of these directives should have a different value than what's in the include file,
then override it in that particular location.


location /uploads {

include proxy.conf;

client_max_body_size 500m;

proxy_connect_timeout 75;

proxy_send_timeout 90;

proxy_read_timeout 90;

proxy_pass http://localhost:8080;
}

The order is important here. If there is more than one occurrence of
a directive in a configuration file (or include), NGINX will take the
value of the directive defined last.
Free download pdf