# HG changeset patch # User Ruslan Ermilov # Date 1318142994 0 # Node ID b9dade63fcc234439382e2abb720d3b80e0a9553 # Parent cce2fd0acc0fd79c70a4656f04ba0e7ff28b45ad The reference documentation is moving elsewhere. diff --git a/docs/GNUmakefile b/docs/GNUmakefile --- a/docs/GNUmakefile +++ b/docs/GNUmakefile @@ -24,7 +24,7 @@ define XSLT endef -all: changes html +all: changes changes: $(TEMP)/$(NGINX)/CHANGES.ru \ $(TEMP)/$(NGINX)/CHANGES @@ -55,27 +55,3 @@ changes: $(TEMP)/$(NGINX)/CHANGES.ru docs/xslt/changes.xslt: docs/xsls/changes.xsls $(call XSLScript, docs/xsls/changes.xsls, $@) - -html: \ - docs/html/ngx_core_module.html \ - docs/html/http/ngx_http_core_module.html \ - docs/html/http/ngx_http_mp4_module.html - -docs/html/%.html: \ - docs/xml/%.xml \ - docs/xslt/module.xslt \ - docs/dtd/module.dtd - $(call XSLT, docs/xslt/module.xslt, $<, $@) - -docs/html/http/%.html: \ - docs/xml/http/%.xml \ - docs/xslt/module.xslt \ - docs/dtd/module.dtd - $(call XSLT, docs/xslt/module.xslt, $<, $@) - -docs/xslt/module.xslt: \ - docs/xslt/directive.xslt \ - docs/xslt/content.xslt - -docs/xslt/%.xslt: docs/xsls/%.xsls - $(call XSLScript, $<, $@) diff --git a/docs/dtd/module.dtd b/docs/dtd/module.dtd deleted file mode 100644 --- a/docs/dtd/module.dtd +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/html/http/ngx_http_core_module.html b/docs/html/http/ngx_http_core_module.html deleted file mode 100644 --- a/docs/html/http/ngx_http_core_module.html +++ /dev/null @@ -1,1287 +0,0 @@ -HTTP Core Module

HTTP Core Module

Directives


syntax: - aio - on | - off | - sendfile
default: - aio off
context: - http, server, location
appeared in version: - 0.8.11

-Enables or disables the use of asynchronous file I/O (AIO) -on FreeBSD and Linux. -

-On FreeBSD, AIO is usable starting from FreeBSD 4.3. -AIO can either be linked statically into a kernel: -

-options VFS_AIO
-
-or loaded dynamically as a kernel loadable module: -
-kldload aio
-

-In FreeBSD versions 5 and 6, enabling AIO statically, or dynamically -when booting the kernel, will cause the entire networking subsystem -to use the Giant lock that can impact overall performance negatively. -This limitation has been removed in FreeBSD 6.4-STABLE in 2009, and in -FreeBSD 7. -However, starting from FreeBSD 5.3 it is possible to enable AIO -without the penalty of running the networking subsystem under a -Giant lock - for this to work, the AIO module needs to be loaded -after the kernel has booted. -In this case, the following message will appear in -/var/log/messages

-WARNING: Network stack Giant-free, but aio requires Giant.
-Consider adding 'options NET_WITH_GIANT' or setting debug.mpsafenet=0
-
-and can safely be ignored. - -The requirement to use the Giant lock with AIO is related to the -fact that FreeBSD supports asynchronous calls -aio_read() -and -aio_write() -when working with sockets. -However, since nginx only uses AIO for disk I/O, no problems should arise. -

-For AIO to work, -sendfile -needs to be disabled: -

-location /video/ {
-    sendfile       off;
-    aio            on;
-    output_buffers 1 64k;
-}
-

-In addition, starting from FreeBSD 5.2.1 and nginx 0.8.12, AIO can -also be used to pre-load data for sendfile(): -

-location /video/ {
-    sendfile       on;
-    tcp_nopush     on;
-    aio            sendfile;
-}
-
-In this configuration, sendfile() is called with -the SF_NODISKIO flag which causes it not to -block on disk I/O and instead report back when the data are not in -memory; nginx then initiates an asynchronous data load by reading -one byte. The FreeBSD kernel then loads the first 128K bytes -of a file into memory, however next reads will only load data -in 16K chunks. This can be tuned using the -read_ahead -directive. -

-On Linux, AIO is usable starting from kernel version 2.6.22; -plus, it is also necessary to enable -directio, -otherwise reading will be blocking: -

-location /video/ {
-    aio            on;
-    directio       512;
-    output_buffers 1 128k;
-}
-

-On Linux, -directio -can only be used for reading blocks that are aligned on 512-byte -boundaries (or 4K for XFS). -Reading of unaligned file's end is still made in blocking mode. -The same holds true for byte range requests, and for FLV requests -not from the beginning of a file: reading of unaligned data at the -beginning and end of a file will be blocking. -There is no need to turn off -sendfile -explicitly as it is turned off automatically when -directio -is used. -


syntax: - alias path
default: - none
context: - location

-Defines a replacement for the specified location. -For example, with the following configuration -

-location /i/ {
-    alias /data/w3/images/;
-}
-
-the request of -“/i/top.gif” will be responded -with the file -“/data/w3/images/top.gif”. -

-The path value can contain variables. -

-If alias is used inside a location defined -with a regular expression then such regular expression should -contain captures and alias should refer to -these captures (0.7.40), for example: -

-location ~ ^/users/(.+\.(?:gif|jpe?g|png))$ {
-    alias /data/w3/images/$1;
-}
-

-When location matches the last part of the directive's value: -

-location /images/ {
-    alias /data/w3/images/;
-}
-
-it is better to use the -root -directive instead: -
-location /images/ {
-    root /data/w3;
-}
-


syntax: - client_body_in_file_only - on | - clean | - off
default: - client_body_in_file_only off
context: - http, server, location

-Determines whether nginx should save the entire client request body -into a file. -This directive can be used during debugging, or when using the -$request_body_file -variable, or the -$r->request_body_file -method of the module -ngx_http_perl_module. -

-When set to the value on, temporary files are not -removed after request processing. -

-The value clean will cause the temporary files -left after request processing to be removed. -


syntax: - client_body_in_single_buffer on | off
default: - client_body_in_single_buffer off
context: - http, server, location

-Determines whether nginx should save the entire client request body -in a single buffer. -The directive is recommended when using the -$request_body -variable, to save the number of copy operations involved. -


syntax: - client_body_buffer_size size
default: - client_body_buffer_size 8k/16k
context: - http, server, location

-Sets buffer size for reading client request body. -In case request body is larger than the buffer, -the whole body or only its part is written to a temporary file. - -By default, buffer size is equal to two memory pages. -This is 8K on x86, other 32-bit platforms, and x86-64. -It is usually 16K on other 64-bit platforms. -


syntax: - client_body_temp_path - path - [level1 - [level2 - [level3]]] -
default: - client_body_temp_path client_body_temp
context: - http, server, location

-Defines a directory for storing temporary files holding client request bodies. -Up to three-level subdirectory hierarchy can be used underneath the specified -directory. -For example, in the following configuration -

-client_body_temp_path /spool/nginx/client_temp 1 2;
-
-a temporary file might look like this: -
-/spool/nginx/client_temp/7/45/00000123457
-


syntax: - client_body_timeout time
default: - client_body_timeout 60
context: - http, server, location

-Defines a timeout for reading client request body. -A timeout is only set between two successive read operations, -not for the transmission of the whole request body. -If a client does not transmit anything within this time, -the client error -408 (Request Time-out) -is returned. -


syntax: - client_header_buffer_size size
default: - client_header_buffer_size 1k
context: - http, server

-Sets buffer size for reading client request header. -For most requests, a buffer of 1K bytes is enough. -However, if a request includes long cookies, or comes from a WAP client, -it may not fit into 1K. -If a request line, or a request header field do not fit entirely into -this buffer then larger buffers are allocated, configured by the -large_client_header_buffers -directive. -


syntax: - client_header_timeout time
default: - client_header_timeout 60
context: - http, server

-Defines a timeout for reading client request header. -If a client does not transmit the entire header within this time, -the client error -408 (Request Time-out) -is returned. -


syntax: - client_max_body_size size
default: - client_max_body_size 1m
context: - http, server, location

-Sets the maximum allowed size of the client request body, -specified in the -Content-Length -request header field. -If it exceeds the configured value, the client error -413 (Request Entity Too Large) -is returned. -Please be aware that -browsers cannot correctly display -this error. -


syntax: - default_type mime-type
default: - default_type text/plain
context: - http, server, location

-Defines a default MIME-type of a response. -


syntax: - directio size | off
default: - directio off
context: - http, server, location
appeared in version: - 0.7.7

-Enables the use of -the O_DIRECT flag (FreeBSD, Linux), -the F_NOCACHE flag (Mac OS X), -or the directio() function (Solaris), -when reading files that are larger than the specified size. -It automatically disables (0.7.15) the use of -sendfile -for a given request. -It could be useful for serving large files: -

-directio 4m;
-
-or when using aio on Linux. -


syntax: - directio_alignment size
default: - directio_alignment 512
context: - http, server, location
appeared in version: - 0.8.11

-Sets an alignment for -directio. -In most cases, a 512-byte alignment is enough, however, when -using XFS under Linux, it needs to be increased to 4K. -


syntax: - error_page - code ... - [=[response]] - uri
default: - none
context: - http, server, location, if in location

-Defines the URI that will be shown for the specified errors. -These directives are inherited from the previous level if and -only if there are no -error_page -directives on -the current level. -A URI value can contain variables. -

-Example: -

-error_page 404         /404.html;
-error_page 502 503 504 /50x.html;
-error_page 403         http://example.com/forbidden.html;
-

-Furthermore, it is possible to change the response code to another, for example: -

-error_page 404 =200 /empty.gif;
-

-If an error response is processed by a proxied server, or a FastCGI server, -and the server may return different response codes (e.g., 200, 302, 401 -or 404), it is possible to respond with a returned code: -

-error_page 404 = /404.php;
-

-If there is no need to change URI during redirection it is possible to redirect -error processing into a named location: -

-location / {
-    error_page 404 = @fallback;
-}
-
-location @fallback {
-    proxy_pass http://backend;
-}
-


syntax: - if_modified_since - off | - exact | - before
default: - if_modified_since exact
context: - http, server, location
appeared in version: - 0.7.24

-Specifies how to compare modification time of a response -with the time in the -If-Modified-Since -request header: - -

off
-the -If-Modified-Since request header is ignored (0.7.34); -
exact
-exact match; -
before
-modification time of a response is -less than or equal to the time in the If-Modified-Since -request header. -


syntax: - internal
default: - none
context: - location

-Specifies that a given location can only be used for internal requests. -For external requests, the client error -404 (Not Found) -is returned. -Internal requests are the following: - -

-Example: -

-error_page 404 /404.html;
-
-location /404.html {
-    internal;
-}
-


syntax: - keepalive_requests number
default: - keepalive_requests 100
context: - http, server, location
appeared in version: - 0.8.0

-Sets the maximum number of requests that can be -made through one keep-alive connection. -


syntax: - keepalive_timeout - time - [time] -
default: - keepalive_timeout 75
context: - http, server, location

-The first argument sets a timeout during which a keep-alive -client connection will stay open on the server side. -The optional second argument sets a value in the -“Keep-Alive: timeout=time” -response header. -Two arguments may differ. -

-The -“Keep-Alive: timeout=” -is understood by Mozilla and Konqueror. -MSIE will close keep-alive connection in about 60 seconds. -


syntax: - large_client_header_buffers number size
default: - large_client_header_buffers 4 4k/8k
context: - http, server

-Sets the maximum number and size of -buffers used when reading large client request headers. -A request line cannot exceed the size of one buffer, or the client error -414 (Request-URI Too Large) -is returned. -A request header field cannot exceed the size of one buffer as well, or the -client error -400 (Bad Request) -is returned. -Buffers are allocated only on demand. -By default, the buffer size is equal to one memory page size. -It is either 4K or 8K, platform dependent. -If after the end of request processing a connection is transitioned -into the keep-alive state, these buffers are freed. -


syntax: - limit_except method ... { ... }
default: - none
context: - location

-Limits allowed HTTP methods inside a location. -The GET method also implies the HEAD method. -Access to other methods can be limited using the -ngx_http_access_module -and -ngx_http_auth_basic_module -modules directives: -

-limit_except GET {
-    allow 192.168.1.0/32;
-    deny  all;
-}
-
-Please note that this will limit access to all methods -except GET and HEAD. -


syntax: - limit_rate rate
default: - none
context: - http, server, location, if in location

-Rate limits the transmission of a response to a client. -The rate is specified in bytes per second. - -The limit is per connection, so if a single client opens 2 connections, -an overall rate will be 2x more than specified. -

-This directive is not applicable if one wants to rate limit -a group of clients on the -server -level. -If that is the case, the desired limit can be specified in the -$limit_rate -variable: -

-server {
-
-    if ($slow) {
-        set $limit_rate 4k;
-    }
-
-    ...
-}
-


syntax: - limit_rate_after size
default: - none
context: - http, server, location, if in location
appeared in version: - 0.8.0

-Sets the initial amount after which the further transmission -of a response to a client will be rate limited. -

-Example: -

-location /flv/ {
-    flv;
-    limit_rate_after 500k;
-    limit_rate       50k;
-}
-


syntax: - listen - address[:port] - [default | default_server - [backlog=number] - [rcvbuf=size] - [sndbuf=size] - [accept_filter=filter] - [deferred] - [bind] - [ipv6only=on|off] - [ssl]] -
       listen - port - [default | default_server - [backlog=number] - [rcvbuf=size] - [sndbuf=size] - [accept_filter=filter] - [deferred] - [bind] - [ipv6only=on|off] - [ssl]] -
default: - listen *:80 | *:8000
context: - server

-Sets an address and a port, on which -the server will accept requests. -Only one of address or port can be -specified. -An address may also be a hostname, for example: -

-listen 127.0.0.1:8000;
-listen 127.0.0.1;
-listen 8000;
-listen *:8000;
-listen localhost:8000;
-
-IPv6 addresses (0.7.36) are specified in square brackets: -
-listen [::]:8000;
-listen [fe80::1];
-

-If only address is given, the port 80 is used. -

-If directive is not present then either the *:80 is used -if nginx runs with superuser privileges, or *:8000 otherwise. -

-The default parameter, if present, -will cause the server to become the default server for the specified -address:port pair. -If none of the directives have the default -parameter then the first server with the -address:port pair will be -the default server for this pair. -Starting from version 0.8.21 it is possible to use the -default_server -parameter. -

-A listen directive which has the default -parameter can have several additional parameters specific to system calls -listen() and bind(). -Starting from version 0.8.21, these parameters can be specified in any -listen directive, but only once for the given -address:port pair. -

backlog=number
-sets the backlog parameter in the -listen() call. -By default, backlog equals -1 on FreeBSD -and 511 on other platforms. -
rcvbuf=size
-sets the SO_RCVBUF parameter for the listening socket. -
sndbuf=size
-sets the SO_SNDBUF parameter for the listening socket. -
accept_filter=filter
-sets the name of the accept filter. -This works only on FreeBSD, acceptable values are dataready -and httpready. -On receipt of the SIGHUP signal, an accept filter can only be -changed in recent versions of FreeBSD, starting from 6.0, 5.4-STABLE -and 4.11-STABLE. -
deferred
-instructs to use a deferred accept() on Linux -using the TCP_DEFER_ACCEPT option. -
bind
-specifies to make a separate bind() call for a given -address:port pair. -This is because nginx will only bind() to -*:port -if there are several listen directives with -the same port but different addresses, and one of the -listen directives listens on all addresses -for the given port (*:port). -It should be noted that in this case a getsockname() -system call will be made to determine an address that accepted a -connection. -If parameters backlog, rcvbuf, -sndbuf, accept_filter, or -deferred are used then for a given -address:port pair -a separate bind() call will always be made. -
ipv6only=on|off
-this parameter (0.7.42) sets the value of the IPV6_V6ONLY -parameter for the listening socket. -This parameter can only be set once on start. -
ssl
-this parameter (0.7.14) does not relate to system calls -listen() and bind(), but allows to -specify that all connections accepted on this port should work in -the SSL mode. -This allows for a more compact configuration for the server operating -in both HTTP and HTTPS modes simultaneously. -
-listen 80;
-listen 443 default ssl;
-

-Example: -

-listen 127.0.0.1 default accept_filter=dataready backlog=1024;
-


syntax: - location [ - = | - ~ | - ~* | - ^~ | - @ - ] uri -{ ... }
default: - none
context: - server

-Sets a configuration based on a request URI. -A location can either be defined by a prefix string, or by a regular expression. -Regular expressions are specified by prepending them with the -“~*” prefix (for case-insensitive matching), or with the -“~” prefix (for case-sensitive matching). -To find a location matching a given request, nginx first checks -locations defined using the prefix strings (prefix locations). -Amongst them, the most specific one is searched. -Then regular expressions are checked, in the order of their appearance -in a configuration file. -A search terminates on the first match, and its corresponding -configuration is used. -If no match with a regular expression location is found then a -configuration of the most specific prefix location is used. -

-For case-insensitive operating systems such as Mac OS X and Cygwin, -the string matching ignores a case (0.7.7). -However, comparison is limited to one-byte locales. -

-Regular expressions can contain captures (0.7.40) that can later -be used in other directives. -

-If the most specific prefix location has the “^~” prefix -then regular expressions are not checked. -

-Also, using the “=” prefix it is possible to define -an exact match of URI and location. -If an exact match is found, the search terminates. -For example, if a “/” request happens frequently, -defining “location = /” will speed up the processing -of these requests, as search terminates right after the first -comparison. -

-In versions from 0.7.1 to 0.8.41, if a request matched the prefix -location without the “=” and “^~” -prefixes, the search also terminated and regular expressions were -not checked. -

-Let's illustrate the above by example: -

-location = / {
-    [ configuration A ]
-}
-
-location / {
-    [ configuration B ]
-}
-
-location ^~ /images/ {
-    [ configuration C ]
-}
-
-location ~* \.(gif|jpg|jpeg)$ {
-    [ configuration D ]
-}
-
-The “/” request will match configuration A, -the “/documents/document.html” request will match -configuration B, -the “/images/1.gif” request will match configuration C, and -the “/documents/1.jpg” request will match configuration D. -

-The “@” prefix defines a named location. -Such a location is not used for a regular request processing, but instead -used for request redirection. -


syntax: - log_not_found on | off
default: - log_not_found on
context: - http, server, location

-Enables or disables logging of errors about not found files into the -error_log. -


syntax: - log_subrequest on | off
default: - log_subrequest off
context: - http, server, location

-Enables or disables logging of subrequests into the -access_log. -


syntax: - merge_slashes on | off
default: - merge_slashes on
context: - http, server

-Enables or disables compression of two or more adjacent slashes -in a URI into a single slash. -

-Note that compression is essential for the correct prefix string -and regular expressions location matching. -Without it, the “//scripts/one.php” request would not match -

-location /scripts/ {
-    ...
-}
-
-and might be processed as a static file, -so it gets converted to “/scripts/one.php”. -

-Turning the compression off can become necessary if a URI -contains base64-encoded names, since base64 uses the "/" character internally. -However, for security considerations, it is better to avoid turning off -the compression. -

-If a directive is specified on the -server -level, which is also a default server, its value will cover -all virtual servers listening on the same address and port. -


syntax: - msie_padding on | off
default: - msie_padding on
context: - http, server, location

-Enables or disables adding of comments to responses with status -greater than 400 for MSIE clients, to pad the response size to 512 bytes. -


syntax: - msie_refresh on | off
default: - msie_refresh off
context: - http, server, location

-Enables or disables issuing refreshes instead of redirects, for MSIE clients. -


syntax: - open_file_cache -max=N -[inactive=time] | -off
default: - open_file_cache off
context: - http, server, location

-Configures a cache that can store: -

-The directive has the following parameters: -

max
-sets the maximum number of elements in the cache; -on cache overflow the least recently used (LRU) elements get removed; -
inactive
-defines a time, after which the element gets removed from the cache -if there were no accesses to it during this time; -by default, it is 60 seconds; -
off
-disables the cache. -

-Example: -

-open_file_cache          max=1000 inactive=20s;
-open_file_cache_valid    30s;
-open_file_cache_min_uses 2;
-open_file_cache_errors   on;
-


syntax: - open_file_cache_errors on | off
default: - open_file_cache_errors off
context: - http, server, location

-Enables or disables caching of file lookup errors by the -open_file_cache. -


syntax: - open_file_cache_min_uses number
default: - open_file_cache_min_uses 1
context: - http, server, location

-Sets the minimum number of file accesses during -the period configured by the inactive parameter -of the open_file_cache directive, -after which a file descriptor will remain open in the cache. -


syntax: - open_file_cache_valid time
default: - open_file_cache_valid 60
context: - http, server, location

-Sets a time after which -open_file_cache -elements should be validated. -


syntax: - optimize_server_names on | off
default: - optimize_server_names on
context: - http, server

-This directive is obsolete. -

-Enables or disables optimization of hostname checking in name-based -virtual servers. -In particular, the checking affects hostnames used in redirects. -If optimization is enabled, and all name-based servers listening on -the same address:port pair have identical configuration, then -names are not checked during request processing, and the first -server name is used in redirects. -In case redirects should use hostnames sent by clients, -optimization needs to be disabled. -


syntax: - port_in_redirect on | off
default: - port_in_redirect on
context: - http, server, location

-Enables or disables specifying the port in redirects issued by nginx. -


syntax: - read_ahead size
default: - read_ahead 0
context: - http, server, location

-Sets the amount of pre-reading when working with files, in the kernel. -

-On Linux, the -posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL) -system call is used, so the size argument is ignored. -

-On FreeBSD, the -fcntl(O_READAHEAD,size) -system call is used, supported in FreeBSD 9.0-CURRENT. -FreeBSD 7 needs to be -patched. -


syntax: - recursive_error_pages on | off
default: - recursive_error_pages off
context: - http, server, location

-Enables or disables doing several redirects using the -error_page -directive. -


syntax: - reset_timedout_connection - on | off
default: - reset_timedout_connection off
context: - http, server, location

-Enables or disables resetting of timed out connections. -The reset is performed as follows: before closing a socket, the -SO_LINGER -option is set on it with a timeout value of 0. -When the socket is closed, a client is sent TCP RST, and all memory -occupied by this socket is freed. -This avoids keeping of an already closed socket with filled buffers -for a long time, in a FIN_WAIT1 state. -

-It should be noted that timed out keep-alive connections are still -closed normally. -


syntax: - resolver address
default: - none
context: - http, server, location

-Sets the address of a name server, for example: -

-resolver 127.0.0.1;
-


syntax: - resolver_timeout time
default: - resolver_timeout 30s
context: - http, server, location

-Sets a timeout for name resolution, for example: -

-resolver_timeout 5s;
-


syntax: - root path
default: - root html
context: - http, server, location, if in location

-Sets the root directory for requests. -For example, with the following configuration -

-location /i/ {
-    root /data/w3;
-}
-
/i/top.gif” will be responded -with the file -“/data/w3/i/top.gif”. -

-The path value can contain variables. -

-A path to the file is constructed by merely adding a URI to the value -of the root directive. -If a URI need to be modified, the -alias directive should be used. -


syntax: - satisfy all | any
default: - satisfy all
context: - location

-Allows access if any of the -ngx_http_access_module -or ngx_http_auth_basic_module -modules grant access. -

-location / {
-    satisfy any;
-
-    allow 192.168.1.0/32;
-    deny  all;
-
-    auth_basic           "closed site";
-    auth_basic_user_file conf/htpasswd;
-}
-


syntax: - satisfy_any on | off
default: - satisfy_any off
context: - location

-This directive was renamed to the satisfy directive. -


syntax: - send_timeout time
default: - send_timeout 60
context: - http, server, location

-Sets a timeout for transmitting a response to the client. -A timeout is only set between two successive write operations, -not for the transmission of the whole response. -If a client does not receive anything within this time, -a connection is closed. -


syntax: - sendfile on | off
default: - sendfile off
context: - http, server, location

-Enables or disables the use of -sendfile(). -


syntax: - server { ... }
default: - none
context: - http

-Sets a configuration for the virtual server. -There is no clean separation between IP-based (based on the IP address) -and name-based (based on the Host request header field) -virtual servers. -Instead, the listen directives describe all -addresses and ports that should accept connections for a server, and the -server_name directive lists all server names. -An example configuration is provided in the - -Setting Up Virtual Servers document. -


syntax: - server_name name ...
default: - server_name hostname
context: - server

-Sets names of the virtual server, for example: -

-server {
-    server_name example.com www.example.com;
-}
-

-The first name becomes a primary server name. -By default, the machine's hostname is used. -Server names can include an asterisk (“*”) -to replace the first or last part of a name: -

-server {
-    server_name example.com *.example.com www.example.*;
-}
-

-The first two of the above mentioned names can be combined: -

-server {
-    server_name .example.com;
-}
-

-It is also possible to use regular expressions in server names, -prepending the name with a tilde (“~”): -

-server {
-    server_name www.example.com ~^www\d+\.example\.com$;
-}
-

-Regular expressions can contain captures (0.7.40) that can later -be used in other directives: -

-server {
-    server_name ~^(www\.)?(.+)$;
-
-    location / {
-        root /sites/$2;
-    }
-}
-
-server {
-    server_name _;
-
-    location / {
-        root /sites/default;
-    }
-}
-

-Starting from version 0.8.25, named captures in regular expressions create -variables that can later be used in other directives: -

-server {
-    server_name ~^(www\.)?(?<domain>.+)$;
-
-    location / {
-        root /sites/$domain;
-    }
-}
-
-server {
-    server_name _;
-
-    location / {
-        root /sites/default;
-    }
-}
-

-Starting from version 0.7.11, it is possible to specify an empty name: -

-server {
-    server_name www.example.com "";
-}
-
-It allows this server to process requests without the Host -header, instead of the default server for the given address:port pair. -

-The name checking order is as follows: -

  1. -full names -
  2. -names with the prefix mask, e.g. “*.example.com
  3. -names with the suffix mask, e.g. “mail.*
  4. -regular expressions -


syntax: - server_name_in_redirect on | off
default: - server_name_in_redirect on
context: - http, server, location

-Enables or disables the use of the primary server name, specified by the -server_name -directive, in redirects issued by nginx. -When disabled, the name from the Host request header field -is used. -If this field is not present, an IP address of the server is used. -


syntax: - server_names_hash_max_size size
default: - server_names_hash_max_size 512
context: - http

-Sets the maximum size of the server names hash tables. -For more information, please refer to -Setting Up Hashes. -


syntax: - server_names_hash_bucket_size size
default: - server_names_hash_bucket_size 32/64/128
context: - http

-Sets the bucket size for the server names hash tables. -Default value depends on the size of the processor's cache line. -For more information, please refer to -Setting Up Hashes. -


syntax: - server_tokens on | off
default: - server_tokens on
context: - http, server, location

-Enables or disables emitting of nginx version in error messages and in the -Server response header field. -


syntax: - tcp_nodelay on | off
default: - tcp_nodelay on
context: - http, server, location

-Enables or disables the use of the TCP_NODELAY option. -The option is enabled only when a connection is transitioned into the -keep-alive state. -


syntax: - tcp_nopush on | off
default: - tcp_nopush off
context: - http, server, location

-Enables or disables the use of -the TCP_NOPUSH socket option on FreeBSD -or the TCP_CORK socket option on Linux. -Opitons are enables only when sendfile is used. -Enabling the option allows to -


syntax: - try_files - file ... - uri
       try_files - file ... - =code
default: - none
context: - location

-Checks the existence of files in the specified order, and uses -the first found file for request processing; the processing -is performed in this location's context. -It is possible to check the directory existence by specifying -the slash at the end of a name, e.g. “$uri/”. -If none of the files were found, an internal redirect to the -uri specified by the last argument is made. -As of version 0.7.51, the last argument can also be a -code: -

-location / {
-    try_files $uri $uri/index.html $uri.html =404;
-}
-

-Example when proxying Mongrel: -

-location / {
-    try_files /system/maintenance.html
-              $uri $uri/index.html $uri.html
-              @mongrel;
-}
-
-location @mongrel {
-    proxy_pass http://mongrel;
-}
-

-Example for Drupal/FastCGI: -

-location / {
-    try_files $uri $uri/ @drupal;
-}
-
-location ~ \.php$ {
-    try_files $uri @drupal;
-
-    fastcgi_pass ...;
-
-    fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
-    fastcgi_param SCRIPT_NAME     $fastcgi_script_name;
-    fastcgi_param QUERY_STRING    $args;
-
-    ... other fastcgi_param's
-}
-
-location @drupal {
-    fastcgi_pass ...;
-
-    fastcgi_param SCRIPT_FILENAME /path/to/index.php;
-    fastcgi_param SCRIPT_NAME     /index.php;
-    fastcgi_param QUERY_STRING    q=$uri&$args;
-
-    ... other fastcgi_param's
-}
-
-In the following example, -
-location / {
-    try_files $uri $uri/ @drupal;
-}
-
-the try_files directive is equivalent to -
-location / {
-    error_page 404 = @drupal;
-    log_not_found off;
-}
-
-And here, -
-location ~ \.php$ {
-    try_files $uri @drupal;
-
-    fastcgi_pass ...;
-
-    fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
-
-    ...
-}
-
try_files checks the existence of the PHP file -before passing the request to the FastCGI server. -

-Example for Wordpress and Joomla: -

-location / {
-    try_files $uri $uri/ @wordpress;
-}
-
-location ~ \.php$ {
-    try_files $uri @wordpress;
-
-    fastcgi_pass ...;
-
-    fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
-    ... other fastcgi_param's
-}
-
-location @wordpress {
-    fastcgi_pass ...;
-
-    fastcgi_param SCRIPT_FILENAME /path/to/index.php;
-    ... other fastcgi_param's
-}
-


syntax: - types { ... }
default: - see below
context: - http, server, location

-Maps file name extensions to MIME types of responses. -Several extensions can map to one type. -The following mappings are configured by default: -

-types {
-    text/html  html;
-    image/gif  gif;
-    image/jpeg jpg;
-}
-

-A sufficiently full mapping table is distributed with nginx in the -conf/mime.types file. -

-To make a particular location emit the -“application/octet-stream” -MIME type for all requests, try the following: -

-location /download/ {
-    types        { }
-    default_type application/octet-stream;
-}
-


syntax: - underscores_in_headers on | off
default: - underscores_in_headers off
context: - http, server

-Enables or disables the use of underscores in client request header fields. -

Embedded Variables

-The module ngx_http_core_module supports embedded variables with -names matching those of the Apache Server. -First of all, these are variables representing client request header -fields, such as, $http_user_agent, $http_cookie, -and so on. -It also supports other variables: -

$args
-arguments in the request line -
$arg_name
-argument name in the request line -
$binary_remote_addr
-client address in a binary form, value's length is always 4 bytes -
$content_length
Content-Length request header field -
$content_type
Content-Type request header field -
$cookie_name
-the name cookie -
$document_root
root directive's value for the current request -
$document_uri
-same as $uri
$host
Host request header field, -or the server name matching a request if this field is not present -
$hostname
-host name -
$http_name
-the name request header field -
$is_args
?” if a request line has arguments, -or an empty string otherwise -
$limit_rate
-allows for connection rate limiting -
$pid
-PID of the worker process -
$request_method
-request method, usually -“GET” or “POST
$remote_addr
-client address -
$remote_port
-client port -
$remote_user
-user name supplied with the Basic authentication -
$realpath_root
root directive's value -for the current request, with all symbolic links resolved to real paths -
$request_filename
-file path for the current query, based on the -root and alias -directives, and the request URI -
$request_body
-request body -

-The variable's value is made available in locations -processed by the -proxy_pass -and -fastcgi_pass -directives. -

$request_body_file
-name of a temporary file with the request body -

-At the end of processing, the file needs to be removed. -To always write a request body to a file, -client_body_in_file_only on -needs be specified. -When passing the name of a temporary file in a proxied request, -or in a request to a FastCGI server, -passing of the request body should be disabled by the -proxy_pass_request_body -and -fastcgi_pass_request_body -directives, respectively. -

$request_uri
-full original request URI (with arguments) -
$query_string
-same as $args
$scheme
-request scheme, “http” or “https
$server_protocol
-request protocol, usually -“HTTP/1.0” -or -“HTTP/1.1
$server_addr
-an address of the server which accepted a request -

-Computing a value of this variable usually requires one system call. -To avoid a system call, the listen directives -must specify addresses and use the bind parameter -

$server_name
-name of the server which accepted a request -
$server_port
-port of the server which accepted a request -
$uri
-current URI in request -

-It may differ from an original, e.g. when doing internal redirects, -or when using index files. -

diff --git a/docs/html/http/ngx_http_mp4_module.html b/docs/html/http/ngx_http_mp4_module.html deleted file mode 100644 --- a/docs/html/http/ngx_http_mp4_module.html +++ /dev/null @@ -1,90 +0,0 @@ -HTTP MP4 Module

HTTP MP4 Module

Summary

-The module ngx_http_mp4_module provides pseudo-streaming -server-side support for H.264/AAC files typically having filename extensions -.mp4, .m4v, -and .m4a. -

-Pseudo-streaming works in alliance with conformant Flash players. -A player sends an HTTP request to the server with a start time -argument in the request URI’s query string (named simply -start -and specified in seconds), and the server responds with a stream -so that its start position corresponds to the requested time, -for example: -

-http://example.com/elephants_dream.mp4?start=238.88
-
-This allows for a random seeking at any time, or starting playback -in the middle of a timeline. -

-To support seeking, H.264-based formats store the metadata -in the so-called “moov atom.” -It is a part of the file that holds the index information for the -whole file. -

-To start playback, a player first needs to read metadata. -This is done by sending a special request with the -start=0 -argument. Many encoding software will insert the metadata at -the end of the file. This is bad for pseudo-streaming: -the metadata needs to be located at the beginning of the file, -or else the entire file will have to be downloaded before it -starts playing. If a file is well-formed (with metadata at the -beginning of a file), nginx just sends back the contents of a file. -Otherwise, it has to read the file and prepare a new stream so that -metadata comes before media data. -This involves some CPU, memory, and disk I/O overhead, -so it is a good idea to - -prepare an original file for pseudo-streaming, -rather than having nginx do this on every such request. -

-For a matching request with a non-zero -start -argument, nginx will read metadata from the file, prepare the -stream starting from the requested offset, and send it to a client. -This has the same overhead as described above. -

-If a matching request does not include the -start -argument, there is no overhead, and the file is just sent as a static resource. -Some players also support byte-range requests, and thus do not require -this module at all. -

-This module is not built by default, it should be enabled with the ---with-http_mp4_module -configuration parameter. - -If you were using the third-party mp4 module, be sure to disable it. -

-A similar pseudo-streaming support for FLV files is provided by the module -ngx_http_flv_module. -

Example Configuration

-location /video/ {
-    mp4;
-    mp4_buffer_size     1m;
-    mp4_max_buffer_size 5m;
-}
-

Directives


syntax: - mp4
default: - none
context: - location

-Turns on module processing in a surrounding location. -


syntax: - mp4_buffer_size size
default: - mp4_buffer_size 512K
context: - http, server, location

-Sets the initial size of a memory buffer used to process MP4 files. -


syntax: - mp4_max_buffer_size size
default: - mp4_max_buffer_size 10M
context: - http, server, location

-During metadata processing, a larger buffer may become necessary. -Its size cannot exceed the specified size, -or else nginx will return the server error -500 (Internal Server Error), -and log the following: -

-"/some/movie/file.mp4" mp4 moov atom is too large:
-12583268, you may want to increase mp4_max_buffer_size
-

diff --git a/docs/html/ngx_core_module.html b/docs/html/ngx_core_module.html deleted file mode 100644 --- a/docs/html/ngx_core_module.html +++ /dev/null @@ -1,148 +0,0 @@ -Core Module

Core Module

Example Configuration

-user www www;
-worker_processes 2;
-
-error_log /var/log/nginx-error.log info;
-
-events {
-    use kqueue;
-    worker_connections 2048;
-}
-
-...
-

Directives


syntax: - daemon on | off
default: - daemon on
context: - main

-Determines whether nginx should become a daemon. -Mainly used during development. -


syntax: - env VAR[=VALUE]
default: - env TZ
context: - main

-Allows to limit a set of environment variables, change their values, -or create new environment variables, for the following cases: -

-The TZ variable is always inherited and made available to the module -ngx_http_perl_module, -unless configured explicitly. -

-Usage example: -

-env MALLOC_OPTIONS;
-env PERL5LIB=/data/site/modules;
-env OPENSSL_ALLOW_PROXY_CERTS=1;
-


syntax: - include file | mask
default: - none
context: - any

-Includes another file, or files matching the -specified mask, into configuration. -Included files should consist of -syntactically correct directives and blocks. -

-Usage example: -

-include mime.types;
-include vhosts/*.conf;
-


syntax: - master_process on | off
default: - master_process on
context: - main

-Determines whether worker processes are started. -This directive is intended for nginx developers. -


syntax: - pid file
default: - pid nginx.pid
context: - main

-Defines a file which will store the process ID of the main process. -


syntax: - ssl_engine device
default: - none
context: - main

-Defines the name of the hardware SSL accelerator. -


syntax: - user user [group]
default: - user nobody nobody
context: - main

-Defines user and group -credentials used by worker processes. -If group is omitted, a group whose name equals -that of user is used. -


syntax: - timer_resolution interval
default: - none
context: - main

-Reduces timer resolution in worker processes, thus reducing the -number of gettimeofday() system calls made. -By default, gettimeofday() is called each time -on receiving a kernel event. -With reduced resolution, gettimeofday() is only -called once per specified interval. -

-Example: -

-timer_resolution 100ms;
-

-An internal implementation of interval depends on the method used: -


syntax: - worker_rlimit_core size
default: - none
context: - main

-Changes the limit on the largest size of a core file -(RLIMIT_CORE) for worker processes. -Used to increase the limit without restarting the main process. -


syntax: - worker_rlimit_nofile number
default: - none
context: - main

-Changes the limit on the maximum number of open files -(RLIMIT_NOFILE) for worker processes. -Used to increase the limit without restarting the main process. -


syntax: - worker_priority number
default: - worker_priority 0
context: - main

-Defines a scheduling priority for worker processes like is -done by the nice: a negative -number -means higher priority. -Allowed range normally varies from -20 to 20. -

-Example: -

-worker_priority -10;
-


syntax: - worker_processes number
default: - worker_processes 1
context: - main

-Defines the number of worker processes. -


syntax: - working_directory directory
default: - none
context: - main

-Defines a current working directory for a worker process. -It is primarily used when writing a core-file, in which case -a working process should have write permission for the -specified directory. -

diff --git a/docs/xml/http/ngx_http_core_module.xml b/docs/xml/http/ngx_http_core_module.xml deleted file mode 100644 --- a/docs/xml/http/ngx_http_core_module.xml +++ /dev/null @@ -1,2194 +0,0 @@ - - - - - - -
- - -aio - on | - off | - sendfile - -aio off -http -server -location - - -Enables or disables the use of asynchronous file I/O (AIO) -on FreeBSD and Linux. - - - -On FreeBSD, AIO is usable starting from FreeBSD 4.3. -AIO can either be linked statically into a kernel: - -options VFS_AIO - -or loaded dynamically as a kernel loadable module: - -kldload aio - - - - -In FreeBSD versions 5 and 6, enabling AIO statically, or dynamically -when booting the kernel, will cause the entire networking subsystem -to use the Giant lock that can impact overall performance negatively. -This limitation has been removed in FreeBSD 6.4-STABLE in 2009, and in -FreeBSD 7. -However, starting from FreeBSD 5.3 it is possible to enable AIO -without the penalty of running the networking subsystem under a -Giant lock—for this to work, the AIO module needs to be loaded -after the kernel has booted. -In this case, the following message will appear in -/var/log/messages - -WARNING: Network stack Giant-free, but aio requires Giant. -Consider adding 'options NET_WITH_GIANT' or setting debug.mpsafenet=0 - -and can safely be ignored. - -The requirement to use the Giant lock with AIO is related to the -fact that FreeBSD supports asynchronous calls -aio_read -and -aio_write -when working with sockets. -However, since nginx only uses AIO for disk I/O, no problems should arise. - - - - -For AIO to work, -sendfile -needs to be disabled: - -location /video/ { - sendfile off; - aio on; - output_buffers 1 64k; -} - - - - -In addition, starting from FreeBSD 5.2.1 and nginx 0.8.12, AIO can -also be used to pre-load data for sendfile: - -location /video/ { - sendfile on; - tcp_nopush on; - aio sendfile; -} - -In this configuration, sendfile is called with -the SF_NODISKIO flag which causes it not to -block on disk I/O and instead report back when the data are not in -memory; nginx then initiates an asynchronous data load by reading -one byte. The FreeBSD kernel then loads the first 128K bytes -of a file into memory, however next reads will only load data -in 16K chunks. This can be tuned using the -read_ahead -directive. - - - -On Linux, AIO is usable starting from kernel version 2.6.22; -plus, it is also necessary to enable -directio, -otherwise reading will be blocking: - -location /video/ { - aio on; - directio 512; - output_buffers 1 128k; -} - - - - -On Linux, -directio -can only be used for reading blocks that are aligned on 512-byte -boundaries (or 4K for XFS). -Reading of unaligned file's end is still made in blocking mode. -The same holds true for byte range requests, and for FLV requests -not from the beginning of a file: reading of unaligned data at the -beginning and end of a file will be blocking. -There is no need to turn off -sendfile -explicitly as it is turned off automatically when -directio -is used. - - - - - - -alias path - -location - - -Defines a replacement for the specified location. -For example, with the following configuration - -location /i/ { - alias /data/w3/images/; -} - -the request of -/i/top.gif will be responded -with the file -/data/w3/images/top.gif. - - - -The path value can contain variables. - - - -If alias is used inside a location defined -with a regular expression then such regular expression should -contain captures and alias should refer to -these captures (0.7.40), for example: - -location ~ ^/users/(.+\.(?:gif|jpe?g|png))$ { - alias /data/w3/images/$1; -} - - - - -When location matches the last part of the directive's value: - -location /images/ { - alias /data/w3/images/; -} - -it is better to use the -root -directive instead: - -location /images/ { - root /data/w3; -} - - - - - - - -client_body_in_file_only - on | - clean | - off - -client_body_in_file_only off -http -server -location - - -Determines whether nginx should save the entire client request body -into a file. -This directive can be used during debugging, or when using the -$request_body_file -variable, or the -$r->request_body_file -method of the module -ngx_http_perl_module. - - - -When set to the value on, temporary files are not -removed after request processing. - - - -The value clean will cause the temporary files -left after request processing to be removed. - - - - - - -client_body_in_single_buffer on | off - -client_body_in_single_buffer off -http -server -location - - -Determines whether nginx should save the entire client request body -in a single buffer. -The directive is recommended when using the -$request_body -variable, to save the number of copy operations involved. - - - - - - - -client_body_buffer_size size -client_body_buffer_size 8k/16k -http -server -location - - -Sets buffer size for reading client request body. -In case request body is larger than the buffer, -the whole body or only its part is written to a temporary file. - -By default, buffer size is equal to two memory pages. -This is 8K on x86, other 32-bit platforms, and x86-64. -It is usually 16K on other 64-bit platforms. - - - - - - -client_body_temp_path - path - [level1 - [level2 - [level3]]] - -client_body_temp_path client_body_temp -http -server -location - - -Defines a directory for storing temporary files holding client request bodies. -Up to three-level subdirectory hierarchy can be used underneath the specified -directory. -For example, in the following configuration - -client_body_temp_path /spool/nginx/client_temp 1 2; - -a temporary file might look like this: - -/spool/nginx/client_temp/7/45/00000123457 - - - - - - - -client_body_timeout time -client_body_timeout 60 -http -server -location - - -Defines a timeout for reading client request body. -A timeout is only set between two successive read operations, -not for the transmission of the whole request body. -If a client does not transmit anything within this time, -the client error - -is returned. - - - - - - -client_header_buffer_size size -client_header_buffer_size 1k -http -server - - -Sets buffer size for reading client request header. -For most requests, a buffer of 1K bytes is enough. -However, if a request includes long cookies, or comes from a WAP client, -it may not fit into 1K. -If a request line, or a request header field do not fit entirely into -this buffer then larger buffers are allocated, configured by the -large_client_header_buffers -directive. - - - - - - -client_header_timeout time -client_header_timeout 60 -http -server - - -Defines a timeout for reading client request header. -If a client does not transmit the entire header within this time, -the client error - -is returned. - - - - - - -client_max_body_size size -client_max_body_size 1m -http -server -location - - -Sets the maximum allowed size of the client request body, -specified in the -
Content-Length
-request header field. -If it exceeds the configured value, the client error - -is returned. -Please be aware that -browsers cannot correctly display -this error. -
- -
- - - -default_type mime-type -default_type text/plain -http -server -location - - -Defines a default MIME-type of a response. - - - - - - -directio size | off -directio off -http -server -location - - -Enables the use of -the O_DIRECT flag (FreeBSD, Linux), -the F_NOCACHE flag (Mac OS X), -or the directio function (Solaris), -when reading files that are larger than the specified size. -It automatically disables (0.7.15) the use of -sendfile -for a given request. -It could be useful for serving large files: - -directio 4m; - -or when using aio on Linux. - - - - - - -directio_alignment size -directio_alignment 512 -http -server -location - - -Sets an alignment for -directio. -In most cases, a 512-byte alignment is enough, however, when -using XFS under Linux, it needs to be increased to 4K. - - - - - - -error_page - code ... - [=[response]] - uri - - -http -server -location -if in location - - -Defines the URI that will be shown for the specified errors. -These directives are inherited from the previous level if and -only if there are no -error_page -directives on -the current level. -A URI value can contain variables. - - - -Example: - -error_page 404 /404.html; -error_page 502 503 504 /50x.html; -error_page 403 http://example.com/forbidden.html; - - - - -Furthermore, it is possible to change the response code to another, for example: - -error_page 404 =200 /empty.gif; - - - - -If an error response is processed by a proxied server, or a FastCGI server, -and the server may return different response codes (e.g., 200, 302, 401 -or 404), it is possible to respond with a returned code: - -error_page 404 = /404.php; - - - - -If there is no need to change URI during redirection it is possible to redirect -error processing into a named location: - -location / { - error_page 404 = @fallback; -} - -location @fallback { - proxy_pass http://backend; -} - - - - - - - -if_modified_since - off | - exact | - before - -if_modified_since exact -http -server -location - - -Specifies how to compare modification time of a response -with the time in the -
If-Modified-Since
-request header: - - - -off - -the -
If-Modified-Since
request header is ignored (0.7.34); -
- -exact - -exact match; - - -before - -modification time of a response is -less than or equal to the time in the
If-Modified-Since
-request header. -
- -
-
- -
- - - -internal - -location - - -Specifies that a given location can only be used for internal requests. -For external requests, the client error - -is returned. -Internal requests are the following: - - - - -requests redirected by the error_page directive; - - - -subrequests formed by the -include virtual -command of the module -ngx_http_ssi_module; - - - -requests changed by the -rewrite -directive of the module -ngx_http_rewrite_module. - - - - - - -Example: - -error_page 404 /404.html; - -location /404.html { - internal; -} - - - - - - - -keepalive_requests number -keepalive_requests 100 -http -server -location - - -Sets the maximum number of requests that can be -made through one keep-alive connection. - - - - - - -keepalive_timeout - time - [time] - -keepalive_timeout 75 -http -server -location - - -The first argument sets a timeout during which a keep-alive -client connection will stay open on the server side. -The optional second argument sets a value in the -
Keep-Alive: timeout=time
-response header. -Two arguments may differ. -
- - -The -
Keep-Alive: timeout=
-is understood by Mozilla and Konqueror. -MSIE will close keep-alive connection in about 60 seconds. -
- -
- - - -large_client_header_buffers number size -large_client_header_buffers 4 4k/8k -http -server - - -Sets the maximum number and size of -buffers used when reading large client request headers. -A request line cannot exceed the size of one buffer, or the client error - -is returned. -A request header field cannot exceed the size of one buffer as well, or the -client error - -is returned. -Buffers are allocated only on demand. -By default, the buffer size is equal to one memory page size. -It is either 4K or 8K, platform dependent. -If after the end of request processing a connection is transitioned -into the keep-alive state, these buffers are freed. - - - - - - -limit_except method ... { ... } - -location - - -Limits allowed HTTP methods inside a location. -The GET method also implies the HEAD method. -Access to other methods can be limited using the -ngx_http_access_module -and -ngx_http_auth_basic_module -modules directives: - -limit_except GET { - allow 192.168.1.0/32; - deny all; -} - -Please note that this will limit access to all methods -except GET and HEAD. - - - - - - -limit_rate rate - -http -server -location -if in location - - -Rate limits the transmission of a response to a client. -The rate is specified in bytes per second. - -The limit is per connection, so if a single client opens 2 connections, -an overall rate will be 2x more than specified. - - - -This directive is not applicable if one wants to rate limit -a group of clients on the -server -level. -If that is the case, the desired limit can be specified in the -$limit_rate -variable: - -server { - - if ($slow) { - set $limit_rate 4k; - } - - ... -} - - - - - - - -limit_rate_after size - -http -server -location -if in location - - -Sets the initial amount after which the further transmission -of a response to a client will be rate limited. - - - -Example: - -location /flv/ { - flv; - limit_rate_after 500k; - limit_rate 50k; -} - - - - - - - -listen - address[:port] - [default | default_server - [backlog=number] - [rcvbuf=size] - [sndbuf=size] - [accept_filter=filter] - [deferred] - [bind] - [ipv6only=on|off] - [ssl]] - -listen - port - [default | default_server - [backlog=number] - [rcvbuf=size] - [sndbuf=size] - [accept_filter=filter] - [deferred] - [bind] - [ipv6only=on|off] - [ssl]] - -listen *:80 | *:8000 -server - - -Sets an address and a port, on which -the server will accept requests. -Only one of address or port can be -specified. -An address may also be a hostname, for example: - -listen 127.0.0.1:8000; -listen 127.0.0.1; -listen 8000; -listen *:8000; -listen localhost:8000; - -IPv6 addresses (0.7.36) are specified in square brackets: - -listen [::]:8000; -listen [fe80::1]; - - - - -If only address is given, the port 80 is used. - - - -If directive is not present then either the *:80 is used -if nginx runs with superuser privileges, or *:8000 otherwise. - - - -The default parameter, if present, -will cause the server to become the default server for the specified -address:port pair. -If none of the directives have the default -parameter then the first server with the -address:port pair will be -the default server for this pair. -Starting from version 0.8.21 it is possible to use the -default_server -parameter. - - - -A listen directive which has the default -parameter can have several additional parameters specific to system calls -listen and bind. -Starting from version 0.8.21, these parameters can be specified in any -listen directive, but only once for the given -address:port pair. - - - -backlog=number - - -sets the backlog parameter in the -listen call. -By default, backlog equals -1 on FreeBSD -and 511 on other platforms. - - - -rcvbuf=size - - -sets the SO_RCVBUF parameter for the listening socket. - - - -sndbuf=size - - -sets the SO_SNDBUF parameter for the listening socket. - - - -accept_filter=filter - - -sets the name of the accept filter. -This works only on FreeBSD, acceptable values are dataready -and httpready. -On receipt of the SIGHUP signal, an accept filter can only be -changed in recent versions of FreeBSD, starting from 6.0, 5.4-STABLE -and 4.11-STABLE. - - - -deferred - - -instructs to use a deferred accept on Linux -using the TCP_DEFER_ACCEPT option. - - - -bind - - -specifies to make a separate bind call for a given -address:port pair. -This is because nginx will only bind to -*:port -if there are several listen directives with -the same port but different addresses, and one of the -listen directives listens on all addresses -for the given port (*:port). -It should be noted that in this case a getsockname -system call will be made to determine an address that accepted a -connection. -If parameters backlog, rcvbuf, -sndbuf, accept_filter, or -deferred are used then for a given -address:port pair -a separate bind call will always be made. - - - -ipv6only=on|off - - -this parameter (0.7.42) sets the value of the IPV6_V6ONLY -parameter for the listening socket. -This parameter can only be set once on start. - - - -ssl - - -this parameter (0.7.14) does not relate to system calls -listen and bind, but allows to -specify that all connections accepted on this port should work in -the SSL mode. -This allows for a more compact configuration for the server operating -in both HTTP and HTTPS modes simultaneously. - -listen 80; -listen 443 default ssl; - - - - - - - -Example: - -listen 127.0.0.1 default accept_filter=dataready backlog=1024; - - - - - - - -location [ - = | - ~ | - ~* | - ^~ | - @ - ] uri -{ ... } - -server - - - -Sets a configuration based on a request URI. -A location can either be defined by a prefix string, or by a regular expression. -Regular expressions are specified by prepending them with the -~* prefix (for case-insensitive matching), or with the -~ prefix (for case-sensitive matching). -To find a location matching a given request, nginx first checks -locations defined using the prefix strings (prefix locations). -Amongst them, the most specific one is searched. -Then regular expressions are checked, in the order of their appearance -in a configuration file. -A search terminates on the first match, and its corresponding -configuration is used. -If no match with a regular expression location is found then a -configuration of the most specific prefix location is used. - - - -For case-insensitive operating systems such as Mac OS X and Cygwin, -the string matching ignores a case (0.7.7). -However, comparison is limited to one-byte locales. - - - -Regular expressions can contain captures (0.7.40) that can later -be used in other directives. - - - -If the most specific prefix location has the ^~ prefix -then regular expressions are not checked. - - - -Also, using the = prefix it is possible to define -an exact match of URI and location. -If an exact match is found, the search terminates. -For example, if a / request happens frequently, -defining location = / will speed up the processing -of these requests, as search terminates right after the first -comparison. - - - -In versions from 0.7.1 to 0.8.41, if a request matched the prefix -location without the = and ^~ -prefixes, the search also terminated and regular expressions were -not checked. - - - -Let's illustrate the above by example: - -location = / { - [ configuration A ] -} - -location / { - [ configuration B ] -} - -location ^~ /images/ { - [ configuration C ] -} - -location ~* \.(gif|jpg|jpeg)$ { - [ configuration D ] -} - -The / request will match configuration A, -the /documents/document.html request will match -configuration B, -the /images/1.gif request will match configuration C, and -the /documents/1.jpg request will match configuration D. - - - -The @ prefix defines a named location. -Such a location is not used for a regular request processing, but instead -used for request redirection. - - - - - - - - -log_not_found on | off -log_not_found on -http -server -location - - -Enables or disables logging of errors about not found files into the -error_log. - - - - - - -log_subrequest on | off -log_subrequest off -http -server -location - - -Enables or disables logging of subrequests into the -access_log. - - - - - - -merge_slashes on | off -merge_slashes on -http -server - - -Enables or disables compression of two or more adjacent slashes -in a URI into a single slash. - - - -Note that compression is essential for the correct prefix string -and regular expressions location matching. -Without it, the //scripts/one.php request would not match - -location /scripts/ { - ... -} - -and might be processed as a static file, -so it gets converted to /scripts/one.php. - - - -Turning the compression off can become necessary if a URI -contains base64-encoded names, since base64 uses the "/" character internally. -However, for security considerations, it is better to avoid turning off -the compression. - - - -If a directive is specified on the -server -level, which is also a default server, its value will cover -all virtual servers listening on the same address and port. - - - - - - -msie_padding on | off -msie_padding on -http -server -location - - -Enables or disables adding of comments to responses with status -greater than 400 for MSIE clients, to pad the response size to 512 bytes. - - - - - - -msie_refresh on | off -msie_refresh off -http -server -location - - -Enables or disables issuing refreshes instead of redirects, for MSIE clients. - - - - - - -open_file_cache -max=N -[inactive=time] | -off - -open_file_cache off -http -server -location - - -Configures a cache that can store: - - - -open file descriptors, their sizes and modification times; - - - -directory lookups; - - - -file lookup errors, such as "file not found", "no read permission", -and so on. -Caching of errors should be enabled separately by the -open_file_cache_errors -directive. - - - - - - -The directive has the following parameters: - - - -max - - -sets the maximum number of elements in the cache; -on cache overflow the least recently used (LRU) elements get removed; - - - -inactive - - -defines a time, after which the element gets removed from the cache -if there were no accesses to it during this time; -by default, it is 60 seconds; - - - -off - - -disables the cache. - - - - - - -Example: - -open_file_cache max=1000 inactive=20s; -open_file_cache_valid 30s; -open_file_cache_min_uses 2; -open_file_cache_errors on; - - - - - - - - -open_file_cache_errors on | off -open_file_cache_errors off -http -server -location - - -Enables or disables caching of file lookup errors by the -open_file_cache. - - - - - - - - - -open_file_cache_min_uses number -open_file_cache_min_uses 1 -http -server -location - - -Sets the minimum number of file accesses during -the period configured by the inactive parameter -of the open_file_cache directive, -after which a file descriptor will remain open in the cache. - - - - - - -open_file_cache_valid time -open_file_cache_valid 60 -http -server -location - - -Sets a time after which -open_file_cache -elements should be validated. - - - - - - - -optimize_server_names on | off -optimize_server_names on -http -server - - -This directive is obsolete. - - - -Enables or disables optimization of hostname checking in name-based -virtual servers. -In particular, the checking affects hostnames used in redirects. -If optimization is enabled, and all name-based servers listening on -the same address:port pair have identical configuration, then -names are not checked during request processing, and the first -server name is used in redirects. -In case redirects should use hostnames sent by clients, -optimization needs to be disabled. - - - - - - -port_in_redirect on | off -port_in_redirect on -http -server -location - - -Enables or disables specifying the port in redirects issued by nginx. - - - - - - -read_ahead size -read_ahead 0 -http -server -location - - -Sets the amount of pre-reading when working with files, in the kernel. - - - -On Linux, the -posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL) -system call is used, so the size argument is ignored. - - - -On FreeBSD, the -fcntl(O_READAHEAD,size) -system call is used, supported in FreeBSD 9.0-CURRENT. -FreeBSD 7 needs to be -patched. - - - - - - -recursive_error_pages on | off -recursive_error_pages off -http -server -location - - -Enables or disables doing several redirects using the -error_page -directive. - - - - - - -reset_timedout_connection - on | off -reset_timedout_connection off -http -server -location - - -Enables or disables resetting of timed out connections. -The reset is performed as follows: before closing a socket, the -SO_LINGER -option is set on it with a timeout value of 0. -When the socket is closed, a client is sent TCP RST, and all memory -occupied by this socket is freed. -This avoids keeping of an already closed socket with filled buffers -for a long time, in a FIN_WAIT1 state. - - - -It should be noted that timed out keep-alive connections are still -closed normally. - - - - - - -resolver address - -http -server -location - - -Sets the address of a name server, for example: - -resolver 127.0.0.1; - - - - - - - -resolver_timeout time -resolver_timeout 30s -http -server -location - - -Sets a timeout for name resolution, for example: - -resolver_timeout 5s; - - - - - - - -root path -root html -http -server -location -if in location - - -Sets the root directory for requests. -For example, with the following configuration - -location /i/ { - root /data/w3; -} - -/i/top.gif will be responded -with the file -/data/w3/i/top.gif. - - - -The path value can contain variables. - - - -A path to the file is constructed by merely adding a URI to the value -of the root directive. -If a URI need to be modified, the -alias directive should be used. - - - - - - -satisfy all | any -satisfy all -location - - -Allows access if any of the -ngx_http_access_module -or ngx_http_auth_basic_module -modules grant access. - -location / { - satisfy any; - - allow 192.168.1.0/32; - deny all; - - auth_basic "closed site"; - auth_basic_user_file conf/htpasswd; -} - - - - - - - -satisfy_any on | off -satisfy_any off -location - - -This directive was renamed to the satisfy directive. - - - - - - -send_timeout time -send_timeout 60 -http -server -location - - -Sets a timeout for transmitting a response to the client. -A timeout is only set between two successive write operations, -not for the transmission of the whole response. -If a client does not receive anything within this time, -a connection is closed. - - - - - - - -sendfile on | off -sendfile off -http -server -location - - -Enables or disables the use of -sendfile. - - - - - - -server { ... } - -http - - -Sets a configuration for the virtual server. -There is no clean separation between IP-based (based on the IP address) -and name-based (based on the
Host
request header field) -virtual servers. -Instead, the listen directives describe all -addresses and ports that should accept connections for a server, and the -server_name directive lists all server names. -An example configuration is provided in the - -Setting Up Virtual Servers document. -
- -
- - - -server_name name ... -server_name hostname -server - - -Sets names of the virtual server, for example: - -server { - server_name example.com www.example.com; -} - - - - -The first name becomes a primary server name. -By default, the machine's hostname is used. -Server names can include an asterisk (*) -to replace the first or last part of a name: - -server { - server_name example.com *.example.com www.example.*; -} - - - - -The first two of the above mentioned names can be combined: - -server { - server_name .example.com; -} - - - - -It is also possible to use regular expressions in server names, -prepending the name with a tilde (~): - -server { - server_name www.example.com ~^www\d+\.example\.com$; -} - - - - -Regular expressions can contain captures (0.7.40) that can later -be used in other directives: - -server { - server_name ~^(www\.)?(.+)$; - - location / { - root /sites/$2; - } -} - -server { - server_name _; - - location / { - root /sites/default; - } -} - - - - -Starting from version 0.8.25, named captures in regular expressions create -variables that can later be used in other directives: - -server { - server_name ~^(www\.)?(?<domain>.+)$; - - location / { - root /sites/$domain; - } -} - -server { - server_name _; - - location / { - root /sites/default; - } -} - - - - -Starting from version 0.7.11, it is possible to specify an empty name: - -server { - server_name www.example.com ""; -} - -It allows this server to process requests without the
Host
-header, instead of the default server for the given address:port pair. -
- - -The name checking order is as follows: - - - -full names - - - -names with the prefix mask, e.g. *.example.com - - - -names with the suffix mask, e.g. mail.* - - - -regular expressions - - - - - -
- - - -server_name_in_redirect on | off -server_name_in_redirect on -http -server -location - - -Enables or disables the use of the primary server name, specified by the -server_name -directive, in redirects issued by nginx. -When disabled, the name from the
Host
request header field -is used. -If this field is not present, an IP address of the server is used. -
- -
- - - -server_names_hash_max_size size -server_names_hash_max_size 512 -http - - -Sets the maximum size of the server names hash tables. -For more information, please refer to -Setting Up Hashes. - - - - - - -server_names_hash_bucket_size size -server_names_hash_bucket_size 32/64/128 -http - - -Sets the bucket size for the server names hash tables. -Default value depends on the size of the processor's cache line. -For more information, please refer to -Setting Up Hashes. - - - - - - -server_tokens on | off -server_tokens on -http -server -location - - -Enables or disables emitting of nginx version in error messages and in the -
Server
response header field. -
- -
- - - -tcp_nodelay on | off -tcp_nodelay on -http -server -location - - -Enables or disables the use of the TCP_NODELAY option. -The option is enabled only when a connection is transitioned into the -keep-alive state. - - - - - - -tcp_nopush on | off -tcp_nopush off -http -server -location - - -Enables or disables the use of -the TCP_NOPUSH socket option on FreeBSD -or the TCP_CORK socket option on Linux. -Opitons are enables only when sendfile is used. -Enabling the option allows to - - - -send the response header and the beginning of a file in one packet, -on Linux and FreeBSD 4.*; - - - -send a file in full packets. - - - - - - - - - -try_files - file ... - uri - -try_files - file ... - =code - - -location - - -Checks the existence of files in the specified order, and uses -the first found file for request processing; the processing -is performed in this location's context. -It is possible to check the directory existence by specifying -the slash at the end of a name, e.g. $uri/. -If none of the files were found, an internal redirect to the -uri specified by the last argument is made. -As of version 0.7.51, the last argument can also be a -code: - -location / { - try_files $uri $uri/index.html $uri.html =404; -} - - - - -Example when proxying Mongrel: - -location / { - try_files /system/maintenance.html - $uri $uri/index.html $uri.html - @mongrel; -} - -location @mongrel { - proxy_pass http://mongrel; -} - - - - -Example for Drupal/FastCGI: - -location / { - try_files $uri $uri/ @drupal; -} - -location ~ \.php$ { - try_files $uri @drupal; - - fastcgi_pass ...; - - fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_param QUERY_STRING $args; - - ... other fastcgi_param's -} - -location @drupal { - fastcgi_pass ...; - - fastcgi_param SCRIPT_FILENAME /path/to/index.php; - fastcgi_param SCRIPT_NAME /index.php; - fastcgi_param QUERY_STRING q=$uri&$args; - - ... other fastcgi_param's -} - -In the following example, - -location / { - try_files $uri $uri/ @drupal; -} - -the try_files directive is equivalent to - -location / { - error_page 404 = @drupal; - log_not_found off; -} - -And here, - -location ~ \.php$ { - try_files $uri @drupal; - - fastcgi_pass ...; - - fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name; - - ... -} - -try_files checks the existence of the PHP file -before passing the request to the FastCGI server. - - - -Example for Wordpress and Joomla: - -location / { - try_files $uri $uri/ @wordpress; -} - -location ~ \.php$ { - try_files $uri @wordpress; - - fastcgi_pass ...; - - fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name; - ... other fastcgi_param's -} - -location @wordpress { - fastcgi_pass ...; - - fastcgi_param SCRIPT_FILENAME /path/to/index.php; - ... other fastcgi_param's -} - - - - - - - -types { ... } -see below -http -server -location - - -Maps file name extensions to MIME types of responses. -Several extensions can map to one type. -The following mappings are configured by default: - -types { - text/html html; - image/gif gif; - image/jpeg jpg; -} - - - - -A sufficiently full mapping table is distributed with nginx in the -conf/mime.types file. - - - -To make a particular location emit the -application/octet-stream -MIME type for all requests, try the following: - -location /download/ { - types { } - default_type application/octet-stream; -} - - - - - - - -underscores_in_headers on | off -underscores_in_headers off -http -server - - -Enables or disables the use of underscores in client request header fields. - - - - -
- -
- - -The module ngx_http_core_module supports embedded variables with -names matching those of the Apache Server. -First of all, these are variables representing client request header -fields, such as, $http_user_agent, $http_cookie, -and so on. -It also supports other variables: - - -$args - -arguments in the request line - - -$arg_name - -argument name in the request line - - -$binary_remote_addr - -client address in a binary form, value's length is always 4 bytes - - -$content_length - -
Content-Length
request header field -
- -$content_type - -
Content-Type
request header field -
- -$cookie_name - -the name cookie - - -$document_root - -root directive's value for the current request - - -$document_uri - -same as $uri - - -$host - -
Host
request header field, -or the server name matching a request if this field is not present -
- -$hostname - -host name - - -$http_name - -the name request header field - - -$is_args - -? if a request line has arguments, -or an empty string otherwise - - -$limit_rate - -allows for connection rate limiting - - -$pid - -PID of the worker process - - -$request_method - -request method, usually -GET or POST - - -$remote_addr - -client address - - -$remote_port - -client port - - -$remote_user - -user name supplied with the Basic authentication - - -$realpath_root - -root directive's value -for the current request, with all symbolic links resolved to real paths - - -$request_filename - -file path for the current query, based on the -root and alias -directives, and the request URI - - -$request_body - -request body - -The variable's value is made available in locations -processed by the -proxy_pass -and -fastcgi_pass -directives. - - - -$request_body_file - -name of a temporary file with the request body - -At the end of processing, the file needs to be removed. -To always write a request body to a file, -client_body_in_file_only on -needs be specified. -When passing the name of a temporary file in a proxied request, -or in a request to a FastCGI server, -passing of the request body should be disabled by the -proxy_pass_request_body -and -fastcgi_pass_request_body -directives, respectively. - - - -$request_uri - -full original request URI (with arguments) - - -$query_string - -same as $args - - -$scheme - -request scheme, http or https - - -$server_protocol - -request protocol, usually -HTTP/1.0 -or -HTTP/1.1 - - -$server_addr - -an address of the server which accepted a request - -Computing a value of this variable usually requires one system call. -To avoid a system call, the listen directives -must specify addresses and use the bind parameter - - - -$server_name - -name of the server which accepted a request - - -$server_port - -port of the server which accepted a request - - -$uri - -current URI in request - -It may differ from an original, e.g. when doing internal redirects, -or when using index files. - - - -
-
- -
- -
diff --git a/docs/xml/http/ngx_http_mp4_module.xml b/docs/xml/http/ngx_http_mp4_module.xml deleted file mode 100644 --- a/docs/xml/http/ngx_http_mp4_module.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - -
- - -The module ngx_http_mp4_module provides pseudo-streaming -server-side support for H.264/AAC files typically having filename extensions -.mp4, .m4v, -and .m4a. - - - -Pseudo-streaming works in alliance with conformant Flash players. -A player sends an HTTP request to the server with a start time -argument in the request URI’s query string (named simply -start -and specified in seconds), and the server responds with a stream -so that its start position corresponds to the requested time, -for example: - -http://example.com/elephants_dream.mp4?start=238.88 - -This allows for a random seeking at any time, or starting playback -in the middle of a timeline. - - - -To support seeking, H.264-based formats store the metadata -in the so-called “moov atom.” -It is a part of the file that holds the index information for the -whole file. - - - -To start playback, a player first needs to read metadata. -This is done by sending a special request with the -start=0 -argument. Many encoding software will insert the metadata at -the end of the file. This is bad for pseudo-streaming: -the metadata needs to be located at the beginning of the file, -or else the entire file will have to be downloaded before it -starts playing. If a file is well-formed (with metadata at the -beginning of a file), nginx just sends back the contents of a file. -Otherwise, it has to read the file and prepare a new stream so that -metadata comes before media data. -This involves some CPU, memory, and disk I/O overhead, -so it is a good idea to - -prepare an original file for pseudo-streaming, -rather than having nginx do this on every such request. - - - -For a matching request with a non-zero -start -argument, nginx will read metadata from the file, prepare the -stream starting from the requested offset, and send it to a client. -This has the same overhead as described above. - - - -If a matching request does not include the -start -argument, there is no overhead, and the file is just sent as a static resource. -Some players also support byte-range requests, and thus do not require -this module at all. - - - -This module is not built by default, it should be enabled with the ---with-http_mp4_module -configuration parameter. - -If you were using the third-party mp4 module, be sure to disable it. - - - - -A similar pseudo-streaming support for FLV files is provided by the module -ngx_http_flv_module. - - -
- - -
- - - -location /video/ { - mp4; - mp4_buffer_size 1m; - mp4_max_buffer_size 5m; -} - - - -
- - -
- - -mp4 - -location - - -Turns on module processing in a surrounding location. - - - - - - -mp4_buffer_size size -mp4_buffer_size 512K -http -server -location - - -Sets the initial size of a memory buffer used to process MP4 files. - - - - - - -mp4_max_buffer_size size -mp4_max_buffer_size 10M -http -server -location - - -During metadata processing, a larger buffer may become necessary. -Its size cannot exceed the specified size, -or else nginx will return the server error -, -and log the following: - -"/some/movie/file.mp4" mp4 moov atom is too large: -12583268, you may want to increase mp4_max_buffer_size - - - - - -
- -
diff --git a/docs/xml/ngx_core_module.xml b/docs/xml/ngx_core_module.xml deleted file mode 100644 --- a/docs/xml/ngx_core_module.xml +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - -
- - - -user www www; -worker_processes 2; - -error_log /var/log/nginx-error.log info; - -events { - use kqueue; - worker_connections 2048; -} - -... - - - -
- - -
- - -daemon on | off -daemon on -main - - -Determines whether nginx should become a daemon. -Mainly used during development. - - - - - - -env VAR[=VALUE] -env TZ -main - - -Allows to limit a set of environment variables, change their values, -or create new environment variables, for the following cases: - - - -variable inheritance during a -live upgrade -of an executable file; - - - -use of variables by the module -ngx_http_perl_module; - - - -use of variables by worker processes. -Please bear in mind that controlling system libraries in this way -is not always possible as it is not uncommon for libraries to check -variables only during initialization, well before they can be set -using this directive. -An exception from this is an above mentioned -live upgrade -of an executable file. - - - - - - -The TZ variable is always inherited and made available to the module -ngx_http_perl_module, -unless configured explicitly. - - - -Usage example: - -env MALLOC_OPTIONS; -env PERL5LIB=/data/site/modules; -env OPENSSL_ALLOW_PROXY_CERTS=1; - - - - - - -include file | mask - - - - -Includes another file, or files matching the -specified mask, into configuration. -Included files should consist of -syntactically correct directives and blocks. - - - -Usage example: - -include mime.types; -include vhosts/*.conf; - - - - - - - -master_process on | off -master_process on -main - - -Determines whether worker processes are started. -This directive is intended for nginx developers. - - - - - - -pid file -pid nginx.pid -main - - -Defines a file which will store the process ID of the main process. - - - - - - -ssl_engine device - -main - - -Defines the name of the hardware SSL accelerator. - - - - - - -user user [group] -user nobody nobody -main - - -Defines user and group -credentials used by worker processes. -If group is omitted, a group whose name equals -that of user is used. - - - - - - -timer_resolution interval - -main - - -Reduces timer resolution in worker processes, thus reducing the -number of gettimeofday system calls made. -By default, gettimeofday is called each time -on receiving a kernel event. -With reduced resolution, gettimeofday is only -called once per specified interval. - - - -Example: - -timer_resolution 100ms; - - - - -An internal implementation of interval depends on the method used: - - - -an EVFILT_TIMER filter if kqueue is used; - - - -timer_create if eventport is used; - - - -setitimer otherwise. - - - - - - - - - -worker_rlimit_core size - -main - - -Changes the limit on the largest size of a core file -(RLIMIT_CORE) for worker processes. -Used to increase the limit without restarting the main process. - - - - - - -worker_rlimit_nofile number - -main - - -Changes the limit on the maximum number of open files -(RLIMIT_NOFILE) for worker processes. -Used to increase the limit without restarting the main process. - - - - - - -worker_priority number -worker_priority 0 -main - - -Defines a scheduling priority for worker processes like is -done by the nice command: a negative -number -means higher priority. -Allowed range normally varies from -20 to 20. - - - -Example: - -worker_priority -10; - - - - - - - -worker_processes number -worker_processes 1 -main - - -Defines the number of worker processes. - - - - - - -working_directory directory - -main - - -Defines a current working directory for a worker process. -It is primarily used when writing a core-file, in which case -a working process should have write permission for the -specified directory. - - - - -
- -
diff --git a/docs/xsls/content.xsls b/docs/xsls/content.xsls deleted file mode 100644 --- a/docs/xsls/content.xsls +++ /dev/null @@ -1,67 +0,0 @@ -X:stylesheet { - - X:template = "section[@id and @name]" { -

!{@name}

- !!; - } - - X:template = "section[not(@id) and @name]" { -

!{@name}

- !!; - } - - X:template = "section[not(@id) and not(@name)]" { !!; } - - X:template = "para" {

!!;

} - - X:template = "c-def" { !!; } - - X:template = "c-func" { !!; X:text{()} } - - X:template = "code" { !!; } - - X:template = "command" { !!; } - - X:template = "dq" { - X:text disable-output-escaping="yes" {&ldquo;} - !!; - X:text disable-output-escaping="yes" {&rdquo;} - } - - X:template = "example" {
 !!; 
} - - X:template = "emphasis" { !!; } - - X:template = "header" { !!; } - - X:template = "http-status" { - !{@code} X:text{ (} !{@text} X:text{)} - } - - X:template = "link[@url]" {
!!; } - X:template = "link[@id and not(@doc)]" { !!; } - X:template = "link[@doc and not(@id)]" { - !!; - } - X:template = "link[@id and @doc]" { - !!; - } - X:template = "link" { !!; } - - X:template = "list[@type='bullet']" { } - X:template = "list[@type='enum']" {
    !!;
} - X:template = "listitem" {
  • !!;
  • } - - X:template = "list[@type='tag']" {
    !!;
    } - X:template = "tag-name" {
    !!;
    } - X:template = "tag-desc" {
    !!;
    } - - X:template = "pathname" { !!; } - - X:template = "argument" { !!; } - X:template = "parameter" { !!; } - - X:template = "value" { !!; } - - X:template = "var" { !!; } -} diff --git a/docs/xsls/directive.xsls b/docs/xsls/directive.xsls deleted file mode 100644 --- a/docs/xsls/directive.xsls +++ /dev/null @@ -1,51 +0,0 @@ -X:stylesheet { - - X:template = "directive" { -
    - - - !! "syntax"; - !! "default"; - !! "context"; - X:if "(@appeared-in)" { - appeared in version: !{@appeared-in} - } - !! "para"; - } - - X:template = "syntax" { - X:if "position() = 1" { - syntax: - } else { -         - } - !!;
    - } - - X:template = "default" { - default: - X:if "count(text()) = 0" { - none - } else { - !!; - } -
    - } - - X:template = "context" { - X:if "position() = 1" { - context: - } - X:if "count(text()) = 0" { - any - } else { - !!; - } - X:if "position() != last()" { - X:text{, } - } else { -
    - } - } - -} diff --git a/docs/xsls/module.xsls b/docs/xsls/module.xsls deleted file mode 100644 --- a/docs/xsls/module.xsls +++ /dev/null @@ -1,34 +0,0 @@ -X:stylesheet { - -X:output method="html" indent="no" encoding="utf-8"; - -X:strip-space elements = "*"; - - -X:param XML = "'../xml'"; - -X:var ID = "/module/@id"; - -X:include href = "directive.xslt"; -X:include href = "content.xslt"; - - -X:template = "/module" { - - - !{@name} - - - - -

    !{@name}

    - !!; - - - -} - -} diff --git a/docs/xslt/content.xslt b/docs/xslt/content.xslt deleted file mode 100644 --- a/docs/xslt/content.xslt +++ /dev/null @@ -1,199 +0,0 @@ - - - - - -
    -
    -

    - -

    -
    - - - - - - -
    -

    - -

    -
    - - -
    - - - - - - -

    - -

    -
    - - - - - - - - - - - () - - - - - - - - - - - - - - - - - - &ldquo; - - - - &rdquo; - - - -
    -
    -            
    -         
    -
    -
    - - - - - - - - - - - - - - - - - ( - - ) - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - -
    -
    - - -
  • - -
  • -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/xslt/directive.xslt b/docs/xslt/directive.xslt deleted file mode 100644 --- a/docs/xslt/directive.xslt +++ /dev/null @@ -1,102 +0,0 @@ - - - - - -
    - - - - - - - - - - - - - appeared in version: - - - - -
    - - - - - - - syntax: - - - - -         - - - - - - - -
    -
    - - - - default: - - - - - none - - - - - - - - - - -
    -
    - - - - - - context: - - - - - - any - - - - - - - - - - - - - - , - - - - -
    -
    -
    -
    - -
    diff --git a/docs/xslt/module.xslt b/docs/xslt/module.xslt deleted file mode 100644 --- a/docs/xslt/module.xslt +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - <xsl:value-of select="@name"/> - - - - - - -
    -

    - -

    -
    - - - - - - -
    - -