0

I am not sure if this is technically possible, but if I have set up HAProxy so that an incoming request to http://example.com/hello goes to http://10.0.0.2/hello:

server example-1 10.0.0.2 check verify none

Is it possible to do it so that http://example.com/hello goes to http://10.0.0.2/greeting instead?

user125498
  • 25
  • 4
  • Does [this answer](http://stackoverflow.com/questions/24784517/haproxy-route-and-rewrite-based-on-uri-path) not work for you? – Joe Jan 30 '15 at 07:54

1 Answers1

0

This can done using "reqrep" option .

In backend , add the following the line

reqrep ^([^\ ]\ )/hello(.) \1/greeting\2

The expression converts ur http://10.0.0.2/hello to http://10.0.0.2/greeting .