Maintenance mode for all but my ip

B.R. reallfqq-nginx at
Sat Dec 7 14:58:43 UTC 2013

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
        default                                                    KO
        your_whitelisted_binary_IP_address_value OK

    rewrite ^.*$ $target #Redirecting all traffic according to map-assigned

    location @OK { # Named location to do nothing, i.e. serve content as

    location @KO { # Named location to trap maintenance traffic, spawning a
HTTP 503 error
        return 503;

Untested, thus unsure, but I'd seek something looking like this.
*B. R.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list