"error_page"& "return" bug?

Edho Arief edho at myconan.net
Sun Feb 19 15:23:33 UTC 2012


On Sun, Feb 19, 2012 at 10:20 PM, Nginx User <nginx at nginxuser.net> wrote:
> Arrggghhh!
>
>
> Server {
>        error_page 503 /error_docs/custom503.html;
>        if ( $request_uri !~ \.(jpg|gif|png|css|js)$ ) {
>                set $tt  "T";
>        }
>        if ( $request_uri !~ ^/maintenance/$ ) {
>        set $tt  "${tt}T";
>        }
>        if ( $tt = TT ) {
>                rewrite ^ /maintenance/ redirect;
>        }
>        location /maintenance {
>                internal;
>                return 503;
>        }
>        location /error_docs {
>                internal;
>                alias /server/path/to/error_docs/folder;
>        }
> }
>
> Finally I promise :)
>

...so, the method above is better than using location / { } block? I'm
confused now.


#############
server {
  error_page 503 /error_docs/custom503.html;
  location / {
    return 503;
    ...normal configs...
  }
  location /error_docs/ {
    internal;
    alias /server/path/to/error_docs/folder;
  }
}
#############


-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the nginx mailing list