Created
February 11, 2015 13:26
-
-
Save pbull/f70db0f8c068f533cfaf to your computer and use it in GitHub Desktop.
Restrict access to Acquia non-prod environment by IP.
This file contains 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
# Whitelisted IPs (or regex matching IP ranges). | |
# If the client IP matches any of the whitelisted | |
# IPs the "allowed-ip" var is set. | |
# | |
SetEnvIf AH_Client_IP 12.34.56.78 allowed-ip | |
SetEnvIf AH_Client_IP 23.45.67.89 allowed-ip | |
SetEnvIf AH_Client_IP 34.56.78.90 allowed-ip | |
# This section should be added near the top of the | |
# <IfModule mod_rewrite.c> block. | |
# | |
# Assumes that all environments except prod should | |
# be access-restricted. | |
# | |
RewriteCond %{ENV:allowed-ip} !=1 | |
RewriteCond %{ENV:AH_SITE_ENVIRONMENT} !=prod | |
RewriteRule ^ - [F] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment