I am trying to redirect services running on localhost under various ports to a sub-path on a single port. For example http://127.0.0.100:5687/ to http://127.0.0.1/app/.
The issue I am having is that only the first Virtual Host block works. If I swap the 2 hosts only topmost/first host work. All other hosts return Not Found error.
Here are the apache directives in question:
<VirtualHost *:80>
ServerName app1.example.com
#ServerAlias app1
ProxyRequests Off
ProxyPass /app1 http://127.0.0.1:6687/
ProxyPassReverse /app1 http://127.0.0.1:6687/
</VirtualHost>
<VirtualHost *:80>
ServerName app2.example.com
#ServerAlias app2
ProxyRequests Off
ProxyPass /app2 http://127.0.0.1:7687/
ProxyPassReverse /app2 http://127.0.0.1:7687/
</VirtualHost>
What am I not seeing here? Why does only the first Virtual Host work?