What I have now is several virtual hosts that are identified by subdomain, and then proxied to a server like so:
<VirtualHost *:80> ProxyPass / http://192.168.1.1/ ProxyPassReverse / http://192.168.1.1/ ServerName sub1.example.com </VirtualHost> <VirtualHost *:80> ProxyPass / http://192.168.1.2/ ProxyPassReverse / http://192.168.1.2/ ServerName sub2.example.com </VirtualHost>
What I want to have instead is for apache to proxy based on example.com/sub1, example.com/sub2, etc.
Nothing I have experimented with seems to work as well as the subdomains. I've tried using the Alias directive, Location blocks, etc. but it keeps rewriting the URLs to my browser which of course cannot reach the backend machines. How can this be done correctly?