# HG changeset patch # User Ruslan Ermilov # Date 1477299466 -10800 # Node ID da6a3e401b266a4ae4b5ad60da2fb422a85aee1c # Parent 56b6244ddadbad2be5ba244a52bf6ba81dd67187 Slightly reformatted the error_page description. Information about directives inheritance was moved to the end. Blocks describing various syntaxes of the "uri" argument were put in the following order: - internal redirect to the specified /uri; - internal redirect to a named location; - URL redirection. diff -r 56b6244ddadb -r da6a3e401b26 xml/en/docs/http/ngx_http_core_module.xml --- a/xml/en/docs/http/ngx_http_core_module.xml Mon Oct 24 11:49:51 2016 +0300 +++ b/xml/en/docs/http/ngx_http_core_module.xml Mon Oct 24 11:57:46 2016 +0300 @@ -10,7 +10,7 @@ + rev="62">
@@ -611,10 +611,7 @@ Defines the URI that will be shown for the specified errors. -error_page directives are inherited from the previous -level only if there are no error_page -directives defined on the current level. -A uri value can contain variables. +A uri value can contain variables. @@ -644,17 +641,6 @@ -It is also possible to use redirects for error processing: - -error_page 403 http://example.com/forbidden.html; -error_page 404 =301 http://example.com/notfound.html; - -In this case, by default, the response code 302 is returned to the client. -It can only be changed to one of the redirect status -codes (301, 302, 303, and 307). - - - If there is no need to change URI during internal redirection it is possible to pass error processing into a named location: @@ -670,11 +656,29 @@ -If uri processing leads to an error, +If uri processing leads to an error, the status code of the last occurred error is returned to the client. + +It is also possible to use URL redirects for error processing: + +error_page 403 http://example.com/forbidden.html; +error_page 404 =301 http://example.com/notfound.html; + +In this case, by default, the response code 302 is returned to the client. +It can only be changed to one of the redirect status +codes (301, 302, 303, and 307). + + + +These directives are inherited from the previous level if and +only if there are no +error_page +directives defined on the current level. + + diff -r 56b6244ddadb -r da6a3e401b26 xml/ru/docs/http/ngx_http_core_module.xml --- a/xml/ru/docs/http/ngx_http_core_module.xml Mon Oct 24 11:49:51 2016 +0300 +++ b/xml/ru/docs/http/ngx_http_core_module.xml Mon Oct 24 11:57:46 2016 +0300 @@ -10,7 +10,7 @@ + rev="62">
@@ -608,10 +608,7 @@ Задаёт URI, который будет показываться для указанных ошибок. -Директивы error_page наследуются с предыдущего уровня -при условии, что на данном уровне не заданы свои директивы -error_page. -В значении uri можно использовать переменные. +В значении uri можно использовать переменные. @@ -640,18 +637,6 @@ -Также существует возможность использовать перенаправления для обработки -ошибок: - -error_page 403 http://example.com/forbidden.html; -error_page 404 =301 http://example.com/notfound.html; - -В этом случае по умолчанию клиенту возвращается код ответа 302. -Его можно изменить только на один из кодов ответа, относящихся к -перенаправлениям (301, 302, 303 и 307). - - - Если при внутреннем перенаправлении не нужно менять URI, то можно передать обработку ошибки в именованный location: @@ -667,11 +652,28 @@ -Если при обработке uri происходит ошибка, +Если при обработке uri происходит ошибка, клиенту возвращается ответ с кодом последней случившейся ошибки. + +Также существует возможность использовать перенаправления URL для обработки +ошибок: + +error_page 403 http://example.com/forbidden.html; +error_page 404 =301 http://example.com/notfound.html; + +В этом случае по умолчанию клиенту возвращается код ответа 302. +Его можно изменить только на один из кодов ответа, относящихся к +перенаправлениям (301, 302, 303 и 307). + + + +Директивы наследуются с предыдущего уровня при условии, что на данном уровне +не описаны свои директивы error_page. + +