Hi , This is a simple setting .Maybe it can solve your problem .
location / {
allow 1.1.1.1;
allow 1.1.1.2;
allow 1.1.1.3;
deny all;
}
error_page 403 /403.html;
location=/403.html{
proxy_pass http://www.domain.com;
}
On Sun, Oct 17, 2010 at 10:36 PM, Ilan Berkner <iberkner@gmail.com> wrote:
> hi all,
>
> I'd like to only allow a certain set of ip addresses to access one of our
> test sites, and redirect anyone with a different ip address to our primary
> domain.
>
> location / {
> allow 1.1.1.1;
> deny all;
> }
>
> The above code works as expected, but I would like to do something like
> this:
>
> location / {
> if not 1.1.1.1 or 1.1.1.2 or 1.1.1.3 do a 301 redirect to www.domain.com(with request uri)
> }
>
> is this possible?
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx