log_format

Syntax: log_format name [escape=default|json] string ...; Default: log_format combined "..."; Context: http Specifies log format. The escape parameter (1.11.8) allows setting json or default characters escaping in variables, by default, default escaping is used. The log format can contain common variables, and variables that exist only at the time of a log write: $bytes_sent the number of bytes sent to a client $connection connection serial number $connection

keepalive_disable

Syntax: keepalive_disable none | browser ...; Default: keepalive_disable msie6; Context: http, server, location Disables keep-alive connections with misbehaving browsers. The browser parameters specify which browsers will be affected. The value msie6 disables keep-alive connections with old versions of MSIE, once a POST request is received. The value safari disables keep-alive connections with Safari and Safari-like browsers on Mac OS X and Mac OS X-like operating systems. The valu

autoindex

Syntax: autoindex on | off; Default: autoindex off; Context: http, server, location Enables or disables the directory listing output.

fastcgi_max_temp_file_size

Syntax: fastcgi_max_temp_file_size size; Default: fastcgi_max_temp_file_size 1024m; Context: http, server, location When buffering of responses from the FastCGI server is enabled, and the whole response does not fit into the buffers set by the fastcgi_buffer_size and fastcgi_buffers directives, a part of the response can be saved to a temporary file. This directive sets the maximum size of the temporary file. The size of data written to the temporary file at a time is set by the fa

absolute_redirect

Syntax: absolute_redirect on | off; Default: absolute_redirect on; Context: http, server, location This directive appeared in version 1.11.8. If disabled, redirects issued by nginx will be relative. See also server_name_in_redirect and port_in_redirect directives.

proxy_cache_valid

Syntax: proxy_cache_valid [code ...] time; Default: — Context: http, server, location Sets caching time for different response codes. For example, the following directives proxy_cache_valid 200 302 10m; proxy_cache_valid 404 1m; set 10 minutes of caching for responses with codes 200 and 302 and 1 minute for responses with code 404. If only caching time is specified proxy_cache_valid 5m; then only 200, 301, and 302 responses are cached. In addition, the any paramete

geoip_city

Syntax: geoip_city file; Default: — Context: stream Specifies a database used to determine the country, region, and city depending on the client IP address. The following variables are available when using this database: $geoip_area_code telephone area code (US only). This variable may contain outdated information since the corresponding database field is deprecated. $geoip_city_continent_code two-letter continent code, for example, “EU”, “NA”. $geoip_city_country_code tw

Command-line parameters

Command-line parameters nginx supports the following command-line parameters: -? | -h — print help for command-line parameters. -c file — use an alternative configuration file instead of a default file. -g directives — set global configuration directives, for example, nginx -g "pid /var/run/nginx.pid; worker_processes `sysctl -n hw.ncpu`;" -p prefix — set nginx path prefix, i.e. a directory that will keep server files (default value is /usr/local/nginx). -q — suppress non-error mes

memcached_next_upstream

Syntax: memcached_next_upstream error | timeout | invalid_response | not_found | off ...; Default: memcached_next_upstream error timeout; Context: http, server, location Specifies in which cases a request should be passed to the next server: error an error occurred while establishing a connection with the server, passing a request to it, or reading the response header; timeout a timeout has occurred while establishing a connection with the server, passing

read_ahead

Syntax: read_ahead size; Default: read_ahead 0; Context: http, server, location Sets the amount of pre-reading for the kernel when working with file. On Linux, the posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL) system call is used, and so the size parameter is ignored. On FreeBSD, the fcntl(O_READAHEAD, size) system call, supported since FreeBSD 9.0-CURRENT, is used. FreeBSD 7 has to be patched.