ngx_http_js_challenge_module icon indicating copy to clipboard operation
ngx_http_js_challenge_module copied to clipboard

add white list

Open novaws opened this issue 4 years ago • 2 comments

Add please white list for IP and useragents please. to skip challenge.

novaws avatar Sep 09 '21 15:09 novaws

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

simon987 avatar Sep 09 '21 15:09 simon987

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;
       }

        ...
      }
}

bnchdan avatar Sep 16 '22 11:09 bnchdan