is there a way to forward or force a specific page based on source IP address (or multiple IP addresses)?

Igor Sysoev is at rambler-co.ru
Tue Oct 20 22:52:22 MSD 2009


On Tue, Oct 20, 2009 at 01:03:53PM -0400, Ilan Berkner wrote:

> For example:
> 
> IF (source IP address IN list of IP addresses) redirect to somepage.php.

http {

   geo  $someone {
        default      0;
        192.168.1.1  1;
        192.168.2.0  1;
        ...
   }

   server {

       if ($someone) {
           rewrite  ^   /someone.php  last;
       }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list