Problem about rules for deny ips

Pablo Zuñiga pabloze at gmail.com
Thu May 31 16:18:07 UTC 2012


I am trying to configure nginx rules where I allow access only to a
range of IPs but has a rewrite and does not allow this action anyone
have any idea how to configure these types of hits?

for example

        location /internal {
            root /var/www/folder/app/webroot;
            index index.php;
            if (-f $request_filename) {
                break;
            }
            error_page   500 502 503 504  @error_web;

            # Trigger 503 response on maintenance
            set $maintenance 0;
            if (-f /var/www/folder/.mant) {
                set $maintenance 1;
            }
            if ($remote_addr = 127.0.0.1) {
                set $mant 0;
            }
            if ($maintenance) {
                return 503;
           }
           if (!-f $request_filename) {
                rewrite ^/(.+)$ /index.php?url=$1 last;
                break;
           }
           allow xxx.xxx.xxx.0/24;
          	deny all;
        }

-- 
Atte.
Pablo Zúñiga E
(+56 9) - 75195192
MSN && Gtalk: pabloze at gmail.com | Skype: ed00m_
=======================================================



More information about the nginx mailing list