Hi , This is a simple setting  .Maybe it  can solve your  problem .<br><br>location / {<br>allow 1.1.1.1;<br>allow 1.1.1.2;<br>allow 1.1.1.3;<br>deny all;<br>}<br><br>error_page 403 /403.html;<br>location=/403.html{<br>    proxy_pass <a href="http://www.domain.com">http://www.domain.com</a>;<br>
}<br><br><br><br><br><br><div class="gmail_quote">On Sun, Oct 17, 2010 at 10:36 PM, Ilan Berkner <span dir="ltr">&lt;<a href="mailto:iberkner@gmail.com">iberkner@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
hi all,<div><br></div><div>I&#39;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.</div><div><br></div><div>location / {</div>

<div>  allow 1.1.1.1;</div><div>  deny all;</div><div>}</div><div><br></div><div>The above code works as expected, but I would like to do something like this:</div><div><br></div><div><div>location / {</div><div>  if not 1.1.1.1 or 1.1.1.2 or 1.1.1.3 do a 301 redirect to <a href="http://www.domain.com" target="_blank">www.domain.com</a> (with request uri)</div>

<div>}</div></div><div><br></div><div>is this possible?</div><div><br></div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
<br></blockquote></div><br>