"error_page"& "return" bug?

Edho Arief edho at myconan.net
Sun Feb 19 18:36:41 UTC 2012


On Mon, Feb 20, 2012 at 12:56 AM, Nginx User <nginx at nginxuser.net> wrote:
>
> I don't think involving another domain/server to serve a single page
> is a particularly effective approach.
>

Many larger sites use CDN for static contents. And the original config
you wanted (if works) also do exactly that - returning 503 on all
requests.


> As mentioned, this serves the page as required along with the needed resources.
>

Three ifs, two roundtrips on client. Looks much more inefficient to me ;)

>
> I have added it to a file 503.default which I just include (uncomment)
> in my normal server block
>

Or one if line:
if ($uri ~ ^/error_docs/) { return 503; }

No need to comment "error_page ..." and "location ^~ /error_docs/" on
normal operation.

>
> Works for me but as said, not the only possibility.
>


Pretty sure will return 404 when accessing dynamic resources[1].
Hopefully you don't have any or care about the impact.


[1] Images/resources served with rewrites, dynamic javascript/css, etc.

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



More information about the nginx mailing list