I've got the follow config in testing which works.

frontend tester 10.13.200.53:80
  acl url_7095 path_beg -i /7095
  acl url_7096 path_beg -i /7096
  acl url_7097 path_beg -i /7097

  use_backend vidserver_7095 if url_7095
  use_backend vidserver_7096 if url_7096
  use_backend vidserver_7097 if url_7097

backend vidserver_7095
    reqirep ^([^\ ]*)\ /7095/(.*)    \1\ /2
    server vidserver 127.0.0.1:7095 check
and so on.

The problem I'm trying to solve is to make a number of video servers show up on port 80 to keep them from being blocked by poorly configured corp firewalls. To that end I was hoping I could accept connections with HAProxy, read the uri, and rewrite to localhost:port_based_on_uri on the fly using a bit of regex. If it were just 3-4 per server I'd leave it as above, but it's closer to 40 or so per server with the content system scheduling to different servers based on concurrent servers. I could ultimately just configure all possible iterations on each server, but was hoping for a less brute force approach. In any case going through the docs I think the following is the right path, but so far I haven't found anything that works or is a large syntax violation.

frontend tester 10.13.200.53:80
  option http_proxy
  option httpclose
  acl url_7095 path_beg -i /7095
  use_backend localhost_vidserver if acl url_7095

backend localhost_vidserver
  # reqirep ^([^\ ]*)\ /(.*)/(.*)    localhost:2 /3
  reqirep ^([^\ ]*)\ /7095/(.*)    localhost:7095 /2
  server localhost 127.0.0.1

Any pointers to how to approach this or that my use case is not supported would be appreciated.

Ramin

Reply via email to