Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add white list #10

Open
novaws opened this issue Sep 9, 2021 · 2 comments
Open

add white list #10

novaws opened this issue Sep 9, 2021 · 2 comments

Comments

@novaws
Copy link

novaws commented Sep 9, 2021

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

@simon987
Copy link
Owner

simon987 commented Sep 9, 2021

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

@bnchdan
Copy link
Contributor

bnchdan commented Sep 16, 2022

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

        ...
      }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants