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 />
        Redirect permanent / https://internal.server2.com
  • Do you want the Redirect to happen for everything not in /console, then? Or just for the / location? – Shane Madden May 24 '13 at 2:15
  • Redirect everything that isn't /console. To add to that if it is /console reverse proxy to web application console aka Weblogic console. – Gareth May 24 '13 at 8:15

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:

<LocationMatch "!^/console">
    Redirect permanent / https://internal.server2.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.