How to disable http basic auth in nginx for a specific ip range?

Use satisfy directive to allow access. 32934 is facebook autonomous system, look facebook ip.

satisfy  any;
allow 66.220.144.0/20;
allow 66.220.152.0/21;
allow ...
deny   all;

auth_basic            "closed site";
auth_basic_user_file  conf/htpasswd;