hi, is there a way to use nginx to publish the maintenance file

Pascal Nitsche pascal.nitsche at fansubcode.org
Thu Apr 7 12:15:49 MSD 2011


  Hello!

To return a http status simply add "return STATUS_CODE;" to your config 
location. So to return a 503 type:

return 503;

MfG

Am 07.04.2011 10:13, schrieb Spacelee:
> thanks, it works using try_files, and I put it in the location / { }
> I try to setup 503 as you suggest, but I don't know how to trigger the 
> 503 status?
>
>
> On Wed, Mar 23, 2011 at 11:39 PM, Vitaly Tskhovrebov <vt at chgk.info 
> <mailto:vt at chgk.info>> wrote:
>
>     On 3/23/2011 6:35 PM, Space Lee wrote:
>
>         I have a question, if I want to use nginx to main the
>         maintenance file, and what's the easiest way for me to change
>         a web to maintained status when it's in emergency?
>
>
>     try_files  /www/maintenance.html $uri  $uri/
>
>     It will be better to return 503 in that case as well.
>
>     -- 
>     Regards, Vitaly Tskhovrebov
>     System Administrator
>     U.S. +1 (206) 905-9939 <tel:%2B1%20%28206%29%20905-9939>
>     Russia +7 911 094-2035 <tel:%2B7%20911%20094-2035>
>
>     _______________________________________________
>     nginx mailing list
>     nginx at nginx.org <mailto:nginx at nginx.org>
>     http://nginx.org/mailman/listinfo/nginx
>
>
>
>
> -- 
> *Space Lee*
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110407/9a9b91fe/attachment.html>


More information about the nginx mailing list