implemented ip matching based on remote_ip as well as x-forwarded-for header