# HG changeset patch # User Ruslan Ermilov # Date 1327402882 0 # Node ID a4fa80755eabe9acb9a3c72ff66a617753a01422 # Parent 55c1c4a1748f02ce66c7d43e6ce67c6ca20c73cf Consistently strip initial offset in examples. diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_access_module.xml --- a/xml/en/docs/http/ngx_http_access_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_access_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -20,12 +20,12 @@ - location / { - deny 192.168.1.1; - allow 192.168.1.0/24; - allow 10.1.1.0/16; - deny all; - } +location / { + deny 192.168.1.1; + allow 192.168.1.0/24; + allow 10.1.1.0/16; + deny all; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_addition_module.xml --- a/xml/en/docs/http/ngx_http_addition_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_addition_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -23,10 +23,10 @@ - location / { - add_before_body /before_action; - add_after_body /after_action; - } +location / { + add_before_body /before_action; + add_after_body /after_action; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_auth_basic_module.xml --- a/xml/en/docs/http/ngx_http_auth_basic_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_auth_basic_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -21,10 +21,10 @@ - location / { - auth_basic "closed site"; - auth_basic_user_file conf/htpasswd; - } +location / { + auth_basic "closed site"; + auth_basic_user_file conf/htpasswd; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_autoindex_module.xml --- a/xml/en/docs/http/ngx_http_autoindex_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_autoindex_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -23,9 +23,9 @@ - location / { - autoindex on; - } +location / { + autoindex on; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_browser_module.xml --- a/xml/en/docs/http/ngx_http_browser_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_browser_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -42,34 +42,34 @@ Choosing an index file: - modern_browser_value "modern."; +modern_browser_value "modern."; - modern_browser msie 5.5; - modern_browser gecko 1.0.0; - modern_browser opera 9.0; - modern_browser safari 413; - modern_browser konqueror 3.0; +modern_browser msie 5.5; +modern_browser gecko 1.0.0; +modern_browser opera 9.0; +modern_browser safari 413; +modern_browser konqueror 3.0; - index index.${modern_browser}html index.html; +index index.${modern_browser}html index.html; Redirection for old browsers: - modern_browser msie 5.0; - modern_browser gecko 0.9.1; - modern_browser opera 8.0; - modern_browser safari 413; - modern_browser konqueror 3.0; +modern_browser msie 5.0; +modern_browser gecko 0.9.1; +modern_browser opera 8.0; +modern_browser safari 413; +modern_browser konqueror 3.0; - modern_browser unlisted; +modern_browser unlisted; - ancient_browser Links Lynx netscape4; +ancient_browser Links Lynx netscape4; - if ($ancient_browser) { - rewrite ^ /ancient.html; - } +if ($ancient_browser) { + rewrite ^ /ancient.html; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_charset_module.xml --- a/xml/en/docs/http/ngx_http_charset_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_charset_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -37,10 +37,10 @@ - include conf/koi-win; +include conf/koi-win; - charset windows-1251; - source_charset koi8-r; +charset windows-1251; +source_charset koi8-r; diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_empty_gif_module.xml --- a/xml/en/docs/http/ngx_http_empty_gif_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_empty_gif_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -20,9 +20,9 @@ - location = /_.gif { - empty_gif; - } +location = /_.gif { + empty_gif; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_fastcgi_module.xml --- a/xml/en/docs/http/ngx_http_fastcgi_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_fastcgi_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -586,11 +586,11 @@ An address can be specified as a domain name or an address, and a port, for example, - fastcgi_pass localhost:9000; +fastcgi_pass localhost:9000; or as a UNIX-domain socket path: - fastcgi_pass unix:/tmp/fastcgi.socket; +fastcgi_pass unix:/tmp/fastcgi.socket; diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_flv_module.xml --- a/xml/en/docs/http/ngx_http_flv_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_flv_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -33,9 +33,9 @@ - location ~ \.flv$ { - flv; - } +location ~ \.flv$ { + flv; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_gzip_module.xml --- a/xml/en/docs/http/ngx_http_gzip_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_gzip_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -21,10 +21,10 @@ - gzip on; - gzip_min_length 1000; - gzip_proxied expired no-cache no-store private auth; - gzip_types text/plain application/xml; +gzip on; +gzip_min_length 1000; +gzip_proxied expired no-cache no-store private auth; +gzip_types text/plain application/xml; diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_gzip_static_module.xml --- a/xml/en/docs/http/ngx_http_gzip_static_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_gzip_static_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -27,8 +27,8 @@ - gzip_static on; - gzip_proxied expired no-cache no-store private auth; +gzip_static on; +gzip_proxied expired no-cache no-store private auth; diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_index_module.xml --- a/xml/en/docs/http/ngx_http_index_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_index_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -20,9 +20,9 @@ - location / { - index index.$geo.html index.html; - } +location / { + index index.$geo.html index.html; +} @@ -45,7 +45,7 @@ The last element of the list can be a file with an absolute path. Example: - index index.$geo.html index.0.html /index.html; +index index.$geo.html index.0.html /index.html; @@ -54,13 +54,13 @@ is made, and request can be processed in a different location. For example, with the following configuration: - location = / { - index index.html; - } +location = / { + index index.html; +} - location / { - ... - } +location / { + ... +} a request of “/” will actually be processed in the second location as “/index.html”. diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_limit_conn_module.xml --- a/xml/en/docs/http/ngx_http_limit_conn_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_limit_conn_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -61,12 +61,12 @@ in reply to a request. For example, the directives - limit_conn_zone $binary_remote_addr zone=addr:10m; +limit_conn_zone $binary_remote_addr zone=addr:10m; - server { - location /download/ { - limit_conn addr 1; - } +server { + location /download/ { + limit_conn addr 1; + } allow for only a single connection at a time, per unique IP address. @@ -78,14 +78,14 @@ of connections to the server per client IP and at the same time will limit the total number of connections to the virtual host: - limit_conn_zone $binary_remote_addr zone=perip:10m; - limit_conn_zone $server_name zone=perserver:10m; +limit_conn_zone $binary_remote_addr zone=perip:10m; +limit_conn_zone $server_name zone=perserver:10m; - server { - ... - limit_conn perip 10; - limit_conn perserver 100; - } +server { + ... + limit_conn perip 10; + limit_conn perserver 100; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_limit_req_module.xml --- a/xml/en/docs/http/ngx_http_limit_req_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_limit_req_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -67,11 +67,10 @@ limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; - server { - location /search/ { - limit_req zone=one burst=5; - } - +server { + location /search/ { + limit_req zone=one burst=5; + } allow not more than 1 request per second at an average, with bursts not exceeding 5 requests. @@ -81,7 +80,7 @@ If delaying of excessive requests while requests are being limited is not desired, the parameter nodelay should be used: - limit_req zone=one burst=5 nodelay; +limit_req zone=one burst=5 nodelay; diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_log_module.xml --- a/xml/en/docs/http/ngx_http_log_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_log_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -20,11 +20,11 @@ - log_format gzip '$remote_addr - $remote_user [$time_local] ' - '"$request" $status $bytes_sent ' - '"$http_referer" "$http_user_agent" "$gzip_ratio"'; +log_format gzip '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $bytes_sent ' + '"$http_referer" "$http_user_agent" "$gzip_ratio"'; - access_log /spool/logs/nginx-access.log gzip buffer=32k; +access_log /spool/logs/nginx-access.log gzip buffer=32k; @@ -192,9 +192,9 @@ The configuration always includes the predefined format “combined”: - log_format combined '$remote_addr - $remote_user [$time_local] ' - '"$request" $status $body_bytes_sent ' - '"$http_referer" "$http_user_agent"'; +log_format combined '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $body_bytes_sent ' + '"$http_referer" "$http_user_agent"'; diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_proxy_module.xml --- a/xml/en/docs/http/ngx_http_proxy_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_proxy_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -538,11 +538,11 @@ An address can be specified as a domain name or an address, and a port, for example, - proxy_pass http://localhost:8000/uri/; +proxy_pass http://localhost:8000/uri/; or as a UNIX-domain socket path: - proxy_pass http://unix:/tmp/backend.socket:/uri/; +proxy_pass http://unix:/tmp/backend.socket:/uri/; here a path is specified after the word “unix” and enclosed in two colons. @@ -617,11 +617,11 @@ Server name, its port, and passed URI can be specified using variables: - proxy_pass http://$host$uri; +proxy_pass http://$host$uri; or like this: - proxy_pass $request; +proxy_pass $request; @@ -685,7 +685,7 @@ “Location: http://localhost:8000/two/some/uri/”. The directive - proxy_redirect http://localhost:8000/two/ http://frontend/one/; +proxy_redirect http://localhost:8000/two/ http://frontend/one/; will rewrite this string to “Location: http://frontend/one/some/uri/”. @@ -694,7 +694,7 @@ A server name may be omitted from the replacement string: - proxy_redirect http://localhost:8000/two/ /; +proxy_redirect http://localhost:8000/two/ /; then the primary server’s name and a port, if different from 80, will be substituted. @@ -724,14 +724,14 @@ A replacement string can contain variables: - proxy_redirect http://localhost:8000/ http://$host:$server_port/; +proxy_redirect http://localhost:8000/ http://$host:$server_port/; A redirect can also contain (1.1.11) variables: - proxy_redirect http://$proxy_host:8000/ /; +proxy_redirect http://$proxy_host:8000/ /; @@ -744,17 +744,17 @@ A regular expression can contain named and positional captures, and replacement can reference them: - proxy_redirect ~^(http://[^:]+):\d+(/.+)$ $1$2; - proxy_redirect ~*/user/([^/]+)/(.+)$ http://$1.example.com/$2; +proxy_redirect ~^(http://[^:]+):\d+(/.+)$ $1$2; +proxy_redirect ~*/user/([^/]+)/(.+)$ http://$1.example.com/$2; There could be several proxy_redirect directives: - proxy_redirect default; - proxy_redirect http://localhost:8000/ /; - proxy_redirect http://www.example.com/ /; +proxy_redirect default; +proxy_redirect http://localhost:8000/ /; +proxy_redirect http://www.example.com/ /; @@ -762,10 +762,10 @@ The off parameter cancels all proxy_redirect directives on the current level: - proxy_redirect off; - proxy_redirect default; - proxy_redirect http://localhost:8000/ /; - proxy_redirect http://www.example.com/ /; +proxy_redirect off; +proxy_redirect default; +proxy_redirect http://localhost:8000/ /; +proxy_redirect http://www.example.com/ /; @@ -773,7 +773,7 @@ Using this directive it is also possible to add host names to relative redirects issued by a proxied server: - proxy_redirect / /; +proxy_redirect / /; diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_random_index_module.xml --- a/xml/en/docs/http/ngx_http_random_index_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_random_index_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -29,9 +29,9 @@ - location / { - random_index on; - } +location / { + random_index on; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/en/docs/http/ngx_http_realip_module.xml --- a/xml/en/docs/http/ngx_http_realip_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/en/docs/http/ngx_http_realip_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -26,9 +26,9 @@ - set_real_ip_from 192.168.1.0/24; - set_real_ip_from 192.168.2.1; - real_ip_header X-Real-IP; +set_real_ip_from 192.168.1.0/24; +set_real_ip_from 192.168.2.1; +real_ip_header X-Real-IP; diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_access_module.xml --- a/xml/ru/docs/http/ngx_http_access_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_access_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -21,12 +21,12 @@ - location / { - deny 192.168.1.1; - allow 192.168.1.0/24; - allow 10.1.1.0/16; - deny all; - } +location / { + deny 192.168.1.1; + allow 192.168.1.0/24; + allow 10.1.1.0/16; + deny all; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_addition_module.xml --- a/xml/ru/docs/http/ngx_http_addition_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_addition_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -23,10 +23,10 @@ - location / { - add_before_body /before_action; - add_after_body /after_action; - } +location / { + add_before_body /before_action; + add_after_body /after_action; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_auth_basic_module.xml --- a/xml/ru/docs/http/ngx_http_auth_basic_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_auth_basic_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -21,10 +21,10 @@ - location / { - auth_basic "closed site"; - auth_basic_user_file conf/htpasswd; - } +location / { + auth_basic "closed site"; + auth_basic_user_file conf/htpasswd; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_autoindex_module.xml --- a/xml/ru/docs/http/ngx_http_autoindex_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_autoindex_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -23,9 +23,9 @@ - location / { - autoindex on; - } +location / { + autoindex on; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_browser_module.xml --- a/xml/ru/docs/http/ngx_http_browser_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_browser_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -42,34 +42,34 @@ Выбор индексного файла: - modern_browser_value "modern."; +modern_browser_value "modern."; - modern_browser msie 5.5; - modern_browser gecko 1.0.0; - modern_browser opera 9.0; - modern_browser safari 413; - modern_browser konqueror 3.0; +modern_browser msie 5.5; +modern_browser gecko 1.0.0; +modern_browser opera 9.0; +modern_browser safari 413; +modern_browser konqueror 3.0; - index index.${modern_browser}html index.html; +index index.${modern_browser}html index.html; Перенаправление для старых браузеров: - modern_browser msie 5.0; - modern_browser gecko 0.9.1; - modern_browser opera 8.0; - modern_browser safari 413; - modern_browser konqueror 3.0; +modern_browser msie 5.0; +modern_browser gecko 0.9.1; +modern_browser opera 8.0; +modern_browser safari 413; +modern_browser konqueror 3.0; - modern_browser unlisted; +modern_browser unlisted; - ancient_browser Links Lynx netscape4; +ancient_browser Links Lynx netscape4; - if ($ancient_browser) { - rewrite ^ /ancient.html; - } +if ($ancient_browser) { + rewrite ^ /ancient.html; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_charset_module.xml --- a/xml/ru/docs/http/ngx_http_charset_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_charset_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -37,10 +37,10 @@ - include conf/koi-win; +include conf/koi-win; - charset windows-1251; - source_charset koi8-r; +charset windows-1251; +source_charset koi8-r; diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_empty_gif_module.xml --- a/xml/ru/docs/http/ngx_http_empty_gif_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_empty_gif_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -20,9 +20,9 @@ - location = /_.gif { - empty_gif; - } +location = /_.gif { + empty_gif; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_fastcgi_module.xml --- a/xml/ru/docs/http/ngx_http_fastcgi_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_fastcgi_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -578,11 +578,11 @@ Задаёт адрес FastCGI-сервера. Адрес может быть указан в виде доменного имени или адреса, и порта, например, - fastcgi_pass localhost:9000; +fastcgi_pass localhost:9000; или в виде пути UNIX-сокета: - fastcgi_pass unix:/tmp/fastcgi.socket; +fastcgi_pass unix:/tmp/fastcgi.socket; diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_flv_module.xml --- a/xml/ru/docs/http/ngx_http_flv_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_flv_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -32,9 +32,9 @@ - location ~ \.flv$ { - flv; - } +location ~ \.flv$ { + flv; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_gzip_module.xml --- a/xml/ru/docs/http/ngx_http_gzip_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_gzip_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -21,10 +21,10 @@ - gzip on; - gzip_min_length 1000; - gzip_proxied expired no-cache no-store private auth; - gzip_types text/plain application/xml; +gzip on; +gzip_min_length 1000; +gzip_proxied expired no-cache no-store private auth; +gzip_types text/plain application/xml; diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_gzip_static_module.xml --- a/xml/ru/docs/http/ngx_http_gzip_static_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_gzip_static_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -27,8 +27,8 @@ - gzip_static on; - gzip_proxied expired no-cache no-store private auth; +gzip_static on; +gzip_proxied expired no-cache no-store private auth; diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_index_module.xml --- a/xml/ru/docs/http/ngx_http_index_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_index_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -20,9 +20,9 @@ - location / { - index index.$geo.html index.html; - } +location / { + index index.$geo.html index.html; +} @@ -45,7 +45,7 @@ В конце списка может стоять файл с абсолютным путём. Пример: - index index.$geo.html index.0.html /index.html; +index index.$geo.html index.0.html /index.html; @@ -55,13 +55,13 @@ location’е. Например, в такой конфигурации: - location = / { - index index.html; - } +location = / { + index index.html; +} - location / { - ... - } +location / { + ... +} запрос “/” будет фактически обработан во втором location’е как “/index.html”. diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_limit_conn_module.xml --- a/xml/ru/docs/http/ngx_http_limit_conn_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_limit_conn_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -60,12 +60,12 @@ . Например, директивы - limit_conn_zone $binary_remote_addr zone=addr:10m; +limit_conn_zone $binary_remote_addr zone=addr:10m; - server { - location /download/ { - limit_conn addr 1; - } +server { + location /download/ { + limit_conn addr 1; + } разрешают одновременно обрабатывать не более одного соединения с одного IP-адреса. @@ -79,14 +79,14 @@ с одного клиентского IP-адреса и в то же время ограничивает общее число соединений с виртуальным хостом: - limit_conn_zone $binary_remote_addr zone=perip:10m; - limit_conn_zone $server_name zone=perserver:10m; +limit_conn_zone $binary_remote_addr zone=perip:10m; +limit_conn_zone $server_name zone=perserver:10m; - server { - ... - limit_conn perip 10; - limit_conn perserver 100; - } +server { + ... + limit_conn perip 10; + limit_conn perserver 100; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_limit_req_module.xml --- a/xml/ru/docs/http/ngx_http_limit_req_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_limit_req_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -65,11 +65,10 @@ limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; - server { - location /search/ { - limit_req zone=one burst=5; - } - +server { + location /search/ { + limit_req zone=one burst=5; + } позволяют в среднем не более 1 запроса в секунду со всплесками не более 5 запросов. @@ -79,7 +78,7 @@ Если же избыточные запросы в пределах лимита всплесков задерживать не требуется, то следует использовать параметр nodelay: - limit_req zone=one burst=5 nodelay; +limit_req zone=one burst=5 nodelay; diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_log_module.xml --- a/xml/ru/docs/http/ngx_http_log_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_log_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -20,11 +20,11 @@ - log_format gzip '$remote_addr - $remote_user [$time_local] ' - '"$request" $status $bytes_sent ' - '"$http_referer" "$http_user_agent" "$gzip_ratio"'; +log_format gzip '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $bytes_sent ' + '"$http_referer" "$http_user_agent" "$gzip_ratio"'; - access_log /spool/logs/nginx-access.log gzip buffer=32k; +access_log /spool/logs/nginx-access.log gzip buffer=32k; @@ -187,9 +187,9 @@ В конфигурации всегда существует предопределённый формат “combined”: - log_format combined '$remote_addr - $remote_user [$time_local] ' - '"$request" $status $body_bytes_sent ' - '"$http_referer" "$http_user_agent"'; +log_format combined '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $body_bytes_sent ' + '"$http_referer" "$http_user_agent"'; diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_proxy_module.xml --- a/xml/ru/docs/http/ngx_http_proxy_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_proxy_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -533,11 +533,11 @@ будет отображаться location. Адрес может быть указан в виде доменного имени или адреса, и порта, например, - proxy_pass http://localhost:8000/uri/; +proxy_pass http://localhost:8000/uri/; или в виде пути UNIX-сокета: - proxy_pass http://unix:/tmp/backend.socket:/uri/; +proxy_pass http://unix:/tmp/backend.socket:/uri/; путь указан после слова “unix” и заключён между двумя двоеточиями. @@ -613,11 +613,11 @@ Имя сервера, его порт и передаваемый URI можно также полностью задать с помощью переменных: - proxy_pass http://$host$uri; +proxy_pass http://$host$uri; или так: - proxy_pass $request; +proxy_pass $request; @@ -681,7 +681,7 @@ “Location: http://localhost:8000/two/some/uri/”. Директива - proxy_redirect http://localhost:8000/two/ http://frontend/one/; +proxy_redirect http://localhost:8000/two/ http://frontend/one/; перепишет эту строку в виде “Location: http://frontend/one/some/uri/”. @@ -690,7 +690,7 @@ В заменяемой строке можно не указывать имя сервера: - proxy_redirect http://localhost:8000/two/ /; +proxy_redirect http://localhost:8000/two/ /; тогда будет подставлено основное имя сервера и порт, если он отличен от 80. @@ -719,7 +719,7 @@ В строке замена можно использовать переменные: - proxy_redirect http://localhost:8000/ http://$host:$server_port/; +proxy_redirect http://localhost:8000/ http://$host:$server_port/; @@ -727,7 +727,7 @@ В строке перенаправление тоже можно использовать (1.1.11) переменные: - proxy_redirect http://$proxy_host:8000/ /; +proxy_redirect http://$proxy_host:8000/ /; @@ -740,17 +740,17 @@ Регулярное выражение может содержать именованные и позиционные выделения, а замена ссылаться на них: - proxy_redirect ~^(http://[^:]+):\d+(/.+)$ $1$2; - proxy_redirect ~*/user/([^/]+)/(.+)$ http://$1.example.com/$2; +proxy_redirect ~^(http://[^:]+):\d+(/.+)$ $1$2; +proxy_redirect ~*/user/([^/]+)/(.+)$ http://$1.example.com/$2; Директив proxy_redirect может быть несколько: - proxy_redirect default; - proxy_redirect http://localhost:8000/ /; - proxy_redirect http://www.example.com/ /; +proxy_redirect default; +proxy_redirect http://localhost:8000/ /; +proxy_redirect http://www.example.com/ /; @@ -759,10 +759,10 @@ proxy_redirect на данном уровне: - proxy_redirect off; - proxy_redirect default; - proxy_redirect http://localhost:8000/ /; - proxy_redirect http://www.example.com/ /; +proxy_redirect off; +proxy_redirect default; +proxy_redirect http://localhost:8000/ /; +proxy_redirect http://www.example.com/ /; @@ -770,7 +770,7 @@ С помощью этой директивы можно также добавлять имя хоста к относительным перенаправлениям, выдаваемым проксируемым сервером: - proxy_redirect / /; +proxy_redirect / /; diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_random_index_module.xml --- a/xml/ru/docs/http/ngx_http_random_index_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_random_index_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -28,9 +28,9 @@ - location / { - random_index on; - } +location / { + random_index on; +} diff -r 55c1c4a1748f -r a4fa80755eab xml/ru/docs/http/ngx_http_realip_module.xml --- a/xml/ru/docs/http/ngx_http_realip_module.xml Tue Jan 24 10:15:25 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_realip_module.xml Tue Jan 24 11:01:22 2012 +0000 @@ -26,9 +26,9 @@ - set_real_ip_from 192.168.1.0/24; - set_real_ip_from 192.168.2.1; - real_ip_header X-Real-IP; +set_real_ip_from 192.168.1.0/24; +set_real_ip_from 192.168.2.1; +real_ip_header X-Real-IP;