Custom 503 Error Page

Eden Li eden at
Sun Feb 3 05:47:39 MSK 2008

Hmm... that doesn't seem to work either.  Is it possible that `return  
xxx;` always generates the internal response?

The only thing that would achieve the desired result in this case is  
proxying to some blackhole which would cause the 503 to be caught and  
rewritten according to the error_page directive.

On Feb 3, 2008, at 10:34 AM, Maxim Dounin wrote:
> Just another quick note: due to some implementation wierdness of  
> ngx_http_rewrite_module, it may be required to define error_page  
> _before_ if/return block. Try something like this:
>    error_page 503 /system/maintenance.html;
>    if (-f ...) {
>        return 503;
>    }

More information about the nginx mailing list