Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache mod_proxy proxyPass order of matching

If i have two rules for proxying and they 'overlap', is there a way to specify the most important rule?

Example (part of virtual host def.)

ProxyPass /foo http://bar:8180/
ProxyPass / http://bar:8181/

Here all traffic will be proxied to http://bar:8181/, because it matches the url first.

Is there a way to make /foo/index.html go to http://bar:8180 (order or similar on the proxypass matching)?

like image 705
Rasmus Melgaard Avatar asked Nov 10 '22 01:11

Rasmus Melgaard


1 Answers

The documentation of mod_proxy/2.4 say:

The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration. The first rule that matches wins.

So, perhaps your first rule won't match because of a missing trailing slash (after foo):

ProxyPass /foo/ http://bar:8180/
like image 146
powerpete Avatar answered Nov 15 '22 06:11

powerpete