Redirect a user based in country and querystring value

Hello,

I’m looking for a way to redirect users from some countries and with a
querystring value to a specific page.

I tried this without success:

location /register.php {
if (($geoip_country_code = (BR|PT)) and ($arg_action = “register”)) {
rewrite ^(.*) /page/info/registo.html permanent;
}
}

How can I accomplish this?

Thanks

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,187241,187241#msg-187241

I’m using 0.8.54-4ppa17~lucid full from
https://launchpad.net/~nginx/+archive/stable

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,187241,187242#msg-187242

On Thu, Mar 31, 2011 at 06:06:39PM -0400, nfn wrote:

}
}

How can I accomplish this?

In 0.9.6 you can use

map “$geoip_country_code.$arg_action” $registo {
default 0;
BR.register 1;
PT.register 1;
}

location = /register.php {
if ($registo) {
return 301 /page/info/registo.html;
}
}


Igor S.
http://sysoev.ru/en/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs