Last active
July 11, 2016 14:51
-
-
Save guyromm/e135afeea1e1f4774bbc to your computer and use it in GitHub Desktop.
quick'n'dirty apache2 authenticated http 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
| # quick'n'dirty apache2 authenticated proxy | |
| # do not forget to a2enmod auth_digest , proxy , proxy_* | |
| ProxyRequests On | |
| ProxyVia Off | |
| <Directory /var/www/html> | |
| Options -Indexes | |
| </Directory> | |
| <Proxy "*"> | |
| Require valid-user | |
| AuthType Digest | |
| AuthName "proxy" | |
| #AuthDigestDomain / http://mirror.my.dom/private2/ | |
| AuthDigestProvider file | |
| AuthUserFile /etc/apache2/auth.digest | |
| #host internal.example.com | |
| </Proxy> | |
| <Location /> | |
| Require valid-user | |
| </Location> |
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
| #flask server script to test headers. | |
| from flask import Flask | |
| app = Flask(__name__) | |
| from flask import request | |
| @app.route('/') | |
| def index(): | |
| print request.headers | |
| rt= "route: "+str(request.access_route)+" ; x-forwarded-for: '"+str(request.headers.getlist("X-Forwarded-For"))+"'" | |
| print rt | |
| return rt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment