Created
November 30, 2013 19:05
-
-
Save zviri/7723152 to your computer and use it in GitHub Desktop.
Apache safe config with mod_proxy
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
# simple http authentification with htpasswd | |
<Directory /var/www> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
AuthName "Restricted" | |
AuthGroupFile /dev/null | |
AuthType Basic | |
AuthBasicProvider file | |
AuthUserFile /etc/users/.htpasswd | |
Require user $USER_NAME | |
</Directory> | |
# deny usage of proxy, should be already by default in most apache2 installations | |
<Proxy *> | |
Order deny,allow | |
Deny from all | |
</Proxy> | |
ProxyPass /jenkins http://localhost:8081/jenkins | |
ProxyPassReverse /jenkins http://localhost:8081/jenkins | |
# IMPORTANT: proxy cannot be used as open proxy | |
ProxyRequests Off | |
# controlling access to specific proxy redirection | |
<Proxy http://localhost:8081/*> | |
Order deny,allow | |
Allow from all | |
AuthType Basic | |
AuthName "Password Required" | |
AuthUserFile /etc/users/.htpasswd | |
Require user $USER_NAME | |
</Proxy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment