Maintenance mode for all but my ip

Ian Evans ianevans at digitalhit.com
Sat Dec 7 20:37:11 UTC 2013


On 2013-12-07 15:31, B.R. wrote:
> ​Hello,​
>
> On Sat, Dec 7, 2013 at 6:31 PM, Ian Evans <ianevans at digitalhit.com
> [1]> wrote:
>
>> Thanks. Ill give this a spin. Is there anyway to still trigger the
>> mapping based on the existence of a maintenance.whatever file? Just
>> thinking of the ease of quickly touching the maintenance file to
>> trigger the mapping as opposed to fiddling with the conf and
>> reloading each time you want to do some quick testing.
>
> By giving it 30 seconds of intensive thinking, I am sure you could
> figure this out by yourself, considering you already provided the if
> (-f ***) {...} trick.
>
> Since the
> http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if [2]if
> directive works in server blocks, you could enclose the rewrite rule
> in it to only apply maintenance mode based on the presence (or the
> absence?) of a specific file.
>

Sorry...too many late nights during this migration/upgrade. So I can 
just place the "rewrite ^.*$ $target" into my 'if'. I'll give it a whirl 
as soon as I get some caffeine. :-)



More information about the nginx mailing list