I hope nginx can be handle this such as, if ($http_user_agent ~ MSIE) { allow 127.0.0.1; deny all; } if ($http_cookie ~* "id=([^;] +)(?:;|$)" ) { allow 10.0.0.1; deny all; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,153628,153628#msg-153628