Nginx authentication except those on local network Nginx authentication except those on local network nginx nginx

Nginx authentication except those on local network


I've deleted my previous answer and would like to suggest a solution I've provided below

I did a little search and found this solution to your problem - In code, where you use auth_basic directive, make such changes:

satisfy    any;allow      10.0.0.1/8;   // give access for all internal requestdeny       all;auth_basic "....";        // your auth_basic code goes hereauth_basic_user_file ...; // your auth_basic_user_file goes here

How it works? satisfy directive implies that any or all from next coming access rules must be passed to give access to resource. You can find more details here: satisfy

This should fit your problem perfectly ;)