Posted under » Apache on 07 July 2024
In simple term
<VirtualHost *:*> ServerName www.anoneh.com ProxyPreserveHost On ProxyPass / http://0.0.0.0:8080/ ProxyPassReverse / http://0.0.0.0:8080/ </VirtualHost>
This is useful when you have webservers elsewhere. All apache does is fetch the data from the external websites or other ports as if it is local or port 80.
'ProxyPreserveHost On' if you want your host (www.anoneh.com) to stay. However, this will not send any DNS request to http://0.0.0.0:8080. So if you don't get the page you wanted to see, set to 'ProxyPreserveHost Off' to make it work.
Another thing to note is that it is best to create a ficticious host for the actual server to prevent conflict with an actual URL that is available by DNS.
You can use proxy with mod rewrite and you will can create some cool stuff.
I have used this for Jupyter Notebook and Streamlit.