ngx_http_js_challenge_module
ngx_http_js_challenge_module copied to clipboard
add white list
Add please white list for IP and useragents please. to skip challenge.
I don't have time to work on this project in the near future.
You can take a look at this fork, they seem to have implemented the feature you're looking for: https://github.com/matcap/ngx_http_js_challenge_module
HI,
You can have something like this in nginx conf.
http {
geo $white_user {
default 0;
1.2.3.4/32 1;
4.3.2.1/32 1;
192.168.0.0/16 1;
}
server {
...
js_challenge on;
js_challenge_secret "test";
js_challenge_html /var/www/html/loading.html;
#js_challenge_bucket_duration 600;
js_challenge_title "Verifying your browser...";
...
location /{
proxy_pass http://domain.ro/;
if ($white_user = 1) { return 599; }
}
error_page 599 = @outside;
location @outside {
#if ip in white list set challenge to off
js_challenge off;
set $upstream http://domain.ro;
proxy_pass http://domain.ro;
}
...
}
}