Path matching not working

Hi,
I Tried to add path_beg in the frontend, It ran okay.
When tried to add other path matching in the frontend, they didn’t work.
Here is the sample URL:
/MyReport?%2fsecion1%2fpage2%2frepot5?key=TEST

This works:
use_backend ReportServer if { path_beg /MyReport}

These not work:
use_backend ReportServer if { path_end -i TEST }
use_backend ReportServer if { path_sub -i TEST }
use_backend ReportServer if { path_reg ^/MyReport.*TEST$ }

Any suggestions would be appreciated.

JC

/MyReport?%2fsecion1%2fpage2%2frepot5?key=TEST

The path of this URI is /MyReport, nothing else is a “path” here.

Thanks for the reply.
Any way I can take the whole url to match?

Use pathq:

http://docs.haproxy.org/2.6/configuration.html#7.3.6-pathq

use_backend ReportServer if { pathq -m end -i TEST }
use_backend ReportServer if { pathq -m sub -i TEST }
use_backend ReportServer if { pathq -m reg ^/MyReport.*TEST$ }

I’m now using haproxy 1.8.30, so there is no pathq method.
I’ll replace pathq with query to fullfill this requirement.
Thanks for your hint.

1 Like