Created
October 7, 2015 06:46
-
-
Save algotrader-dotcom/6a0488d212330c9b6294 to your computer and use it in GitHub Desktop.
Apache reverse proxy basic authentication with whitelist IPs
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
## This conf will basic auth for all exept IP from graph.facebook, twitter.. | |
<VirtualHost IP:443> | |
ServerName webapp.com | |
UseCanonicalName Off | |
ErrorLog /etc/httpd/logs/ssl_reverse_error_log | |
CustomLog /etc/httpd/logs/ssl_reverse_access_log combined env=!dontlog | |
RewriteLog "/etc/httpd/logs/ssl_rewrite.log" | |
RewriteLogLevel 3 | |
<Proxy *> | |
AuthType Basic | |
AuthName "Please Log In" | |
AuthUserFile /etc/httpd/.htpasswd | |
Require valid-user | |
Order deny,allow | |
Deny from all | |
Allow from 127.0.0.1, 58.64.198.68, 58.64.198.94, 61.160.209.167, 173.0.82.77, 110.75.146.31, 134.170.104.40, 31.13.95.8, 104.244.42.130 | |
Satisfy any | |
</Proxy> | |
RewriteEngine On | |
SSLProxyEngine on | |
ProxyVia Block | |
ProxyRequests Off | |
ProxyPass / https://backend-java-app:9002/ | |
ProxyPassReverse / https://backend-java-app:9002/ | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment