"error_page"& "return" bug?

Edho Arief edho at myconan.net
Sun Feb 19 17:34:02 UTC 2012


On Mon, Feb 20, 2012 at 12:19 AM, Nginx User <nginx at nginxuser.net> wrote:
> On 19 February 2012 19:44, Edho Arief <edho at myconan.net> wrote:
>> Also have you tried this one? Instead of plain "return 503;" in server block:
> No, I haven't and don't plan to at this time because I have a setup
> that works fine as posted earlier with images, css etc all loading as
> required.
>

For completeness, the version without if (single page - all requests
returning 503, least overhead etc - put other static resources on
different domain/server):

server {
       # listen etc
       ...
       error_page 503 @503;
       return 503;
       location @503 {
               root /;
               # Immediately serves 503 page, not $uri.
               # The fallback should never happen.
               try_files /file/system/path/to/503.html =500;
       }
       ...
}



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



More information about the nginx mailing list