haproxy modify request path

Posted by zcourts on Server Fault See other posts from Server Fault or by zcourts
Published on 2012-09-21T02:06:25Z Indexed on 2012/09/21 3:39 UTC
Read the original article Hit count: 382

Filed under:

I'm just getting started with HAProxy and I was wondering if its possible to modify the request path for an HTTP request.

One of the backend server uses Dropwizard and its assets bundle see here bundle. In my setup

/xyz serves static assets

/api/xyz serves REST resources

With HAProxy I want requests from api.host.com/xyz to be sent to backend/api/xyz and requests from host.com to be sent to backend/

I've gotten most of that working but I can't figure out how to tell HAProxy to change the path, prepending /api/ to anything from api.host.com

Is this possible or am I going about this the wrong way?

© Server Fault or respective owner

Related posts about haproxy