Skip to content

Instantly share code, notes, and snippets.

@b13bs
Created June 1, 2018 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b13bs/c096e80233ea0757e78487e59d7449f3 to your computer and use it in GitHub Desktop.
Save b13bs/c096e80233ea0757e78487e59d7449f3 to your computer and use it in GitHub Desktop.
Snippet of nginx's site config
# allow from LAN, deny from WAN
allow 192.168.1.0/24;
deny all;
# allow from LAN, basicauth from WAN
satisfy any;
allow 192.168.1.0/24;
deny all;
auth_basic "closed site";
auth_basic_user_file /etc/nginx/htpasswd;
# basicauth from LAN, deny from WAN
allow 192.168.1.0/24;
deny all;
auth_basic "closed site";
auth_basic_user_file /etc/nginx/htpasswd;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment