Welcome! Log In Create A New Profile

Advanced

Re: Maintenance mode for all but my ip

Jonathan Matthews
December 07, 2013 04:16PM
On 7 December 2013 15:19, B.R. <reallfqq-nginx@yahoo.fr> wrote:
> Hello,
>
>
> On Sat, Dec 7, 2013 at 4:10 PM, Jonathan Matthews <contact@jpluscplusm.com>
> wrote:
>>
>> > rewrite ^.*$ $target #Redirecting all traffic according to
>> > map-assigned
>>
>> I don't particularly like ^^^ this. It seems like a level of
>> indirection too far ;-)
>
> To me, your solution looks double evil:
> 1°) Using an unneeded 'if' directive

Using "if" is absolutely fine if all you're doing is issuing a return
directly from it. It's only when you try to do things /after/ an "if"
successfully matches that it's considered evil ...

> 2°) Needs modifying each and every location block.

I didn't really pay attention to the scoping of the return. Moving the
return to the most appropriate place in the config shouldn't be too
tricky for the OP to figure out ...

> I was trying to think about something more scalable, self-contained and
> generic. ;o)

What I suggested would work, AFAICT, with a single map, and a
per-server{} "if($not_me){return 503;}". That's hardly onerous, I'd
say ...

YMMV,
Jonathan

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Maintenance mode for all but my ip

Ian Evans December 07, 2013 08:34AM

Re: Maintenance mode for all but my ip

B.R. December 07, 2013 10:00AM

Re: Maintenance mode for all but my ip

Jonathan Matthews December 07, 2013 10:12AM

Re: Maintenance mode for all but my ip

B.R. December 07, 2013 10:20AM

Re: Maintenance mode for all but my ip

Jonathan Matthews December 07, 2013 04:16PM

Re: Maintenance mode for all but my ip

itpp2012 December 07, 2013 04:39PM

Re: Maintenance mode for all but my ip

B.R. December 07, 2013 05:18PM

Re: Maintenance mode for all but my ip

Ian Evans December 07, 2013 12:32PM

Re: Maintenance mode for all but my ip

B.R. December 07, 2013 03:34PM

Re: Maintenance mode for all but my ip

Ian Evans December 07, 2013 03:38PM

Re: Maintenance mode for all but my ip

openletter December 07, 2013 10:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 146
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready