Reverse HTTP Proxy configuration
How to create a reverse HTTP Proxy AKA how to get the content from a webserver delivered by another one.
Problem: Web service is listening at serverA:8081. Client is behind a firewall which does not allow to connect to port 8081. Use a reverse proxy to move the service to port 80 at another serverB:
# Disable Forward Proxy, only Reverese Proxy needed
Allow from all
ProxyPass / http://serverA:8081/
ProxyPassReverse / http://serverA:8081/
CustomLog /var/log/apache/serverB_access_log combined
- serverB runs other web domains too so the proxy is encapsulated in a Virtual host.
- Don't forget to enable the Apache modules proxy and proxy_http.
There are other tools for just forwarding ports from one machine to another. For the problem described above I now use rinetd. The Apache Proxy is modifying the data stream - new lines where missing at some places.