Skip to content

Instantly share code, notes, and snippets.

@fabriceleal
Created January 6, 2014 18:04
Show Gist options
  • Save fabriceleal/8286782 to your computer and use it in GitHub Desktop.
Save fabriceleal/8286782 to your computer and use it in GitHub Desktop.
Apache as proxy
# From:
# http://stackoverflow.com/questions/17475587/setup-mod-proxy-on-apache-http-server
# http://www.forums.serverwatch.com/showthread.php?16887-mod_proxy-problem
# http://serverfault.com/questions/242650/setting-up-a-basic-mod-proxy-virtual-host
# http://stackoverflow.com/questions/14775248/apache-http-proxy-based-on-hostname
# http://stackoverflow.com/questions/1997001/setting-up-a-basic-web-proxy-in-apache
# http://ubuntuforums.org/showthread.php?t=983222
#
# put on httpdvhosts.conf
# this is the bare bones, so if there's any trouble, I'll improve this snippet
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
<VirtualHost *:80>
# You might need to check the main httpd.conf to get the servername
ServerName localhost:80
ProxyPass / http://anotherhost/somedir/
ProxyPassReverse / http://anotherhost/somedir/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment