I'm trying to setup a redirect to https on a specific ServerName but before it does the redirect I'd like it to match a Location path and reverse proxy to a separate server rather than redirect to the https URL. Below is how I thought it would work but it seems that it redirects before doing the reverse proxy. Clearly my apache skills are lacking. Maybe, I need two separate VirtualHosts? Any help would be appreciated.
<VirtualHost *:80>
ServerName domain.com
<Location /console>
ProxyPass http://internal.server.com:8000/console
ProxyPassReverse http://internal.server.com:8000/console
</Location>
<Location />
Redirect permanent / https://internal.server2.com
</Location>
</VirtualHost>
Best Answer
Instead of letting the
Redirect
config apply for all locations, let's avoid applying it for/console
. Remove the<Location />
section and replace it with: