rewrite or internal redirection cycle while internally redirecting to "/error/403.html"

Maxim Dounin mdounin at mdounin.ru
Fri Nov 16 08:27:41 UTC 2012


Hello!

On Fri, Nov 16, 2012 at 12:28:45AM -0600, Landon Loucel wrote:

> When accessing a vhost on my server I receive a 500 internal server error
> and then when viewing the log file I find the error rewrite or internal
> redirection cycle while internally redirecting to "/error/403.html".  I
> have a site working just fine with the exact same vhost configuration.  All
> paths in the config are valid and all permissions are valid and correct.
> Below is the configuration for the vhost in question.  Any assistance would
> be greatly appreciated.
> 
> server {
>         listen *:80;

[...]

>         error_page 400 /error/400.html;
>         error_page 401 /error/401.html;
>         error_page 403 /error/403.html;
>         error_page 404 /error/404.html;
>         error_page 405 /error/405.html;
>         error_page 500 /error/500.html;
>         error_page 502 /error/502.html;
>         error_page 503 /error/503.html;
>         recursive_error_pages on;

You activated "recursive_error_pages", hence any error which will 
in turn result in the same error again will cause infinite loop.  
With 403 it's trivial to cause this effect e.g. by configuring 
insufficient permissions on document root (any path componenent 
of it).

That's, in particular, one of the reasons why 
recursive_error_pages is off by default, and it's not recommended 
to change this unless you understand what are you doing.

[...]

-- 
Maxim Dounin
http://nginx.com/support.html



More information about the nginx mailing list