Custom 503 Error Page

Spirit Spirit lists at ruby-forum.com
Fri Nov 27 01:32:17 MSK 2009


> error_page 503 @503;
> location @503 {
>   rewrite  ^(.*)$  /system/maintenance.html break;
> }
> 
> if (-f $document_root/system/maintenance.html) {
>   return 503;
> }

Great! Thanks to share it works great when I hardcode the return nbr. I 
don't understand why the following code doesn't work...

        error_page 503 @503;
        location @503 {
                set $page 503;
                rewrite  ^(.*)$  /503.html break;

        }

        if ($page = 503) {
                return 503;
        }
        // or why not return $page;

Any tips?

As a sidenote, as I've never done any ruby dev, I had to find an online 
interactive ruby shell to solve the registering captcha :D :P
-- 
Posted via http://www.ruby-forum.com/.




More information about the nginx mailing list