Forum Moderators: phranque
# Match on Itinerary, Intinerary2, ItineraryB
# [server...]
# [server...]
# [server...]
#--------
# Working
#--------
RewriteRule ^/path/Itinerary[2B]*$ balancer://myCluster/backend/somepage.html [P,QSA,L] lbmethod=bybusyness
#--------
# Not working [server...]
#--------
<LocationMatch ^/path/Itinerary[2B]*>
ProxyPass balancer://myCluster/backend/somepage.html
ProxyPassReverse balancer://myCluster/backend/somepage.html
</LocationMatch>
If I remove the expression [2B]* and specify each of the three matches in individual <Location> or <LocationMatch> container they all work.
Can any explain to me why LocationMatch seem to not eval the expression?
Also, both ProxyPass and ProxyPassReverse require two arguments: A local path to be matched, and a target URL. It appears that you have not specified the local path(s) to be proxied to the balancer in your directives:
ProxyPass documentation [httpd.apache.org]
Jim
Since there is no end-anchor on the pattern, there is no meed to specify "and anything else" past the 2 or the B, so I suspect the pattern you want is just <LocationMatch ^/path/Itinerary[2B]>.
I don't see any documentation about the path being optional in the document I cited. Maybe it's different for your version of Apache.
Jim
I'll go back and test some more with the expression. I have tried [2B]*$ too and was thinking that the ?querystring was causing it not to match due to the end of line $ anchor. I will do some more testing but the I need literal "pattern" to match, so the [2B] needs to be optional much like doing a ^/?$ optional trailing slash. Maybe pattern[B2]? will work.
I downloaded and complied a worker mpm version of 2.2.9 from source.
Defining ProxyPass /local [target...] in a location produces the following error. Give it a go, I bet yours does the same. Most of time I do use it outside a <Location> container.
Syntax error on line 35 of /my/path/hidden/conf/extra/dev.conf:
ProxyPass¦ProxyPassMatch can not have a path when defined in a location.
I'll let you know what I find - thanks again.
RewriteRule ^/path/Itinerary[2B]*$ balancer://myCluster/backend/somepage.html [P,QSA,L] lbmethod=bybusyness