Welcome! Log In Create A New Profile

Advanced

Re: Maintenance mode for all but my ip

Ian Evans
December 07, 2013 12:32PM
On 2013-12-07 09:58, B.R. wrote:
> I am new to the use of maps, but I suppose it would fit perfectly,
> using core variables such as the binary IP address:
> Maybe something like:
>
> server {
>     error_page 503 /503.html # Configuring error page
>
>     map $binary_remote_addr $target { # Configuring white-listed IP
> addresses
>        
> default                                                   
> KO
>         your_whitelisted_binary_IP_address_value OK
>     }
>
>     rewrite ^.*$ $target #Redirecting all traffic according to
> map-assigned value
>
>     location @OK { # Named location to do nothing, i.e. serve
> content as usual
>     }
>
>     location @KO { # Named location to trap maintenance traffic,
> spawning a HTTP 503 error
>         return 503;
>     }
> }
>
> Untested, thus unsure, but Id seek something looking like this.

Thanks. I'll 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 touch'ing 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.

_______________________________________________
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: 175
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