Last active
July 25, 2016 16:46
-
-
Save dsmrt/abd067afdafc40caf73120fe173d9ddb to your computer and use it in GitHub Desktop.
Whitelist a IP using htauth (apahce 2.4) when it's behind a Elastic Load Balancer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Directory "/var/www/html/public/"> | |
| DirectoryIndex index.php index.html index.htm | |
| ErrorDocument 404 index.php | |
| Options Indexes FollowSymLinks MultiViews | |
| AllowOverride All | |
| AuthType Basic | |
| AuthName "My Protected Area" | |
| AuthUserFile /path/to/authfile/.htpasswd | |
| SetEnvIF X-Forwarded-For "0.0.0.0" AllowIP #change 0.0.0.0 to your whitelisted ip | |
| <RequireAny> | |
| Require valid-user | |
| Require env AllowIP | |
| </RequireAny> | |
| </Directory> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment