# HG changeset patch # User Ruslan Ermilov # Date 1391862186 -14400 # Node ID cb63563024ebe1120ff54d3cb2c1cd610f15aebc # Parent b841fbb8c577477a477ba0902b23f9668228107b Somewhat clarified how rewrite module works. diff -r b841fbb8c577 -r cb63563024eb xml/en/docs/http/ngx_http_rewrite_module.xml --- a/xml/en/docs/http/ngx_http_rewrite_module.xml Wed Feb 05 18:30:15 2014 +0400 +++ b/xml/en/docs/http/ngx_http_rewrite_module.xml Sat Feb 08 16:23:06 2014 +0400 @@ -10,13 +10,13 @@ + rev="5">
The ngx_http_rewrite_module module is used to -change URIs using regular expressions, return redirects, and +change request URI using regular expressions, return redirects, and conditionally select configurations. @@ -27,21 +27,32 @@ the directives of this module specified on the - level are processed; - - - -a location for a request is searched; + level +are executed sequentially; -the directives of this module specified in the selected - are processed. -If they have been changing a URI, a new location is searched for the new URI. -This cycle may be repeated up to -10 times -after which the error -is returned. +repeatedly: + + + +a + +is searched based on a request URI; + + + +the directives of this module specified inside the found location +are executed sequentially; + + + +the loop is repeated if a request URI was rewritten, +but not more than +10 times. + + + @@ -65,6 +76,12 @@ +If a directive is specified inside the +, +further processing of the request continues in this location. + + + Example: if ($slow) { @@ -224,6 +241,10 @@ + +See also the directive. + + @@ -238,7 +259,7 @@ if -If the specified regular expression matches a URI, the URI is changed +If the specified regular expression matches a request URI, URI is changed as specified in the replacement string. The rewrite directives are executed sequentially in order of their appearance in the configuration file. @@ -262,7 +283,8 @@ break stops processing the current set of -ngx_http_rewrite_module directives; +ngx_http_rewrite_module directives +as with the directive; redirect @@ -349,7 +371,7 @@ -variable value +$variable value server location diff -r b841fbb8c577 -r cb63563024eb xml/ru/docs/http/ngx_http_rewrite_module.xml --- a/xml/ru/docs/http/ngx_http_rewrite_module.xml Wed Feb 05 18:30:15 2014 +0400 +++ b/xml/ru/docs/http/ngx_http_rewrite_module.xml Sat Feb 08 16:23:06 2014 +0400 @@ -10,13 +10,13 @@ + rev="5">
Модуль ngx_http_rewrite_module позволяет -изменять URI с помощью регулярных выражений, делать перенаправления +изменять URI запроса с помощью регулярных выражений, делать перенаправления и выбирать конфигурацию по условию. @@ -26,22 +26,32 @@ -выполняются директивы этого модуля, описанные на уровне -сервера; +последовательно выполняются директивы этого модуля, описанные на уровне +; -ищется location для запроса; +в цикле: + + + +ищется + +по URI запроса; -выполняются директивы этого модуля, описанные в выбранном -, -и если они изменяли URI, то ищется новый location для уже нового URI. -Этот цикл может повторяться до -10 раз, -после чего возвращается ошибка -. +последовательно выполняются директивы этого модуля, +описанные в найденном location; + + + +цикл повторяется, если URI запроса изменялся, +но не более +10 раз. + + + @@ -65,6 +75,12 @@ +Если директива указана внутри +, +дальнейшая обработка запроса продолжается в этом location. + + + Пример: if ($slow) { @@ -223,6 +239,10 @@ + +См. также директиву . + + @@ -237,7 +257,7 @@ if -Если указанное регулярное выражение соответствует URI, URI изменяется +Если указанное регулярное выражение соответствует URI запроса, URI изменяется в соответствии со строкой замены. Директивы rewrite выполняются последовательно, в порядке их следования в конфигурационном файле. @@ -261,7 +281,8 @@ break завершает обработку текущего набора директив модуля -ngx_http_rewrite_module; +ngx_http_rewrite_module +аналогично директиве ; redirect @@ -347,7 +368,7 @@ -переменная значение +$переменная значение server location @@ -427,7 +448,7 @@ нет, поскольку она не имеет отношения к модулю ngx_http_rewrite_module. -Для блока создаётся отдельная конфигурация, +Для блока создаётся отдельная конфигурация. Если условие истинно, запрос получает эту конфигурацию, и в ней limit_rate равен 10k.