On Wed, February 22, 2017 9:02 pm, Lyndon Nerenberg wrote: > My relayd.conf fu is lame and needs help. Given the following config: > > > ---8<---8<--- > > interval 60 > timeout 2000 > > table <webhosts> { w1.example.com w2.example.com w3.example.com } > > http protocol https { > > tcp { nodelay, sack } > match request header append "X-Forwarded-For" value "$REMOTE_ADDR" > match request header append "X-Forwarded-By" \ > value "$SERVER_ADDR:$SERVER_PORT" > match request header set "Connection" value "close" > > } > > relay web { > > listen on 203.0.113.5 port 443 tls > protocol https > > forward with tls to <webhosts> port https mode loadbalance \ > check https "/" code 200 > > } > > ---8<---8<--- > > I am trying to figure out how to intercept request paths beginning with > "/xy/" > so that I can forward them to a different port in the same server pool. > I.e.: > > https://host.example.com/xy/mumblebarge -> > https://<webhosts>:5555/xy/mumblebarge > > https://host.example.com/anything_else -> > https://<webhosts>/anything_else > > It seems this should be possible, but I just can't get my head around > relayd.conf(5) :-( > > --lyndon >
I have an example at work I can dig up tomorrow, but look at the Filter Rules. You need bits like: 'pass request path "/xy" forward to <webhosts-xy> ' and probably a catch all 'pass forward to <webhosts>' for the rest of the traffic. You need to specify the two forwards to the two tables in your relay section. You need two tables since each will go to a different port and the forward to filter only knows about the table name.