In some cases you might want to require HTTP Basic authentication to a site but allow specific IP addresses to skip the username/password. For Apache this can be configured with:
1 2 3 4 5 6 7 8 9 |
Order deny,allow Deny from all AuthType Basic AuthUserFile .htpass AuthName "Protected Area" require valid-user allow from x.x.x.x allow from y.y.y.y Satisfy Any |
For nginx the configuration is:
1 2 3 4 5 6 |
satisfy any; allow x.x.x.x; allow y.y.y.y; deny all; auth_basic "Protected Area"; auth_basic_user_file .htpass; |