0

I have setup apache fronting my services using the following example config.

/etc/apache2/conf-enabled/services.conf

<Location /A>
    ProxyPass http://localhost:8082
    ProxyPassReverse http://localhost:8082
</Location>

<Location /B>
    ProxyPass http://localhost:8083
    ProxyPassReverse http://localhost:8083
</Location>

<Location />
    ProxyPass http://localhost:8084
    ProxyPassReverse http://localhost:8084
</Location>

However adding <Location /> stops all my other proxy pass's from working, I just get an error has occurred, can anyone suggest what I'm doing wrong?

Thanks, Jack

Jack
  • 417
  • 2
  • 8
  • 18

1 Answers1

0

Use LocationMatch with negative lookahead on the last one:

<LocationMatch "^/(?!(A|B)/?)">
    ProxyPass .....
</LocationMatch>

This will have the last one only proxypass if it is NOT /A or /B

Daniel Gruno
  • 114
  • 4