Re: cookie and source IP logic in server block

2013-10-15 Thread sfrazer
Thanks! I wasn't aware you could combine variables like that in a map statement. handy. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,243687,243736#msg-243736 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/n

Re: cookie and source IP logic in server block

2013-10-14 Thread Francis Daly
On Mon, Oct 14, 2013 at 06:16:14PM -0400, sfrazer wrote: Hi there, untested, but... > geo $remote_addr $blocked { > default 0; > include /etc/nginx/conf/nginx-blocked-ips.conf; > } map $blocked$cookie_whatever $reallyblocked { default 0; 1 1; } If it is blocked by geo, and has no c

cookie and source IP logic in server block

2013-10-14 Thread sfrazer
Hello, I'm trying to block certain IP ranges at my nginx server, but would like to offer the ability to bypass the block by completing a back-end CAPTCHA, which would set a cookie. Currently I set the block like so: geo $remote_addr $blocked { default 0; include /etc/nginx/conf/nginx-blocked-ips