What do you expect the final url to look like? What did you try in mod rewrite, because i believe it can do what you have described so far.
On Fri, Oct 30, 2020, 08:06 Pennington,Jim <penni...@oclc.org> wrote: > I'm using Apache 2.4.7 > I'm currently running and old Apache with customized software and need to > change to using a newer Apache. > > How do I parse out the server from the request and send the request to the > process running on that server (and fixed port)? > > Any help is greatly appreciated. > Jim Pennington > > A request can come into an Apache running on one server and the request > needs to be sent a process running on a different server. > We are using fixed ports and the port in the examples is 1234. > > The process that should get the request is derived from the sessionid. > I need to parse out the server and send the request to the process running > on that server. > > Messages come in with GET or POST and /WebZ/... > Somewhere in the message is sessionid=<server>-<1234>-<...>-<...> > > Some requests might have multiple '?' characters. > Some requests might not have any '?' characters. > > Here are some example requests. > GET > /WebZ/MEdit?sessionid=server09.prod-1234-kgv44z4b-pl2l93:editsessionid=2:catpage=html/corc/catalogue.html:entitymytemplateName=marc?sessionid=server09.prod-1234-kgv44z4b-pl2l93 > HTTP/1.1 > > GET > /WebZ/html/corc/helpredirect.html:sessionid=server02.prod-1234-kgvvyfoc-c7bsf2?/WebZ/html/corc/helpredirect.html:sessionid=server02.prod-1234-kgvvyfoc-c7bsf2?http%3A// > www.oclc.org/bibformats/en/fixedfield/dtst.html HTTP/1.1 > > GET > /WebZ/html/catexpress/CatExpressBasicSearch.html:sessionid=server09-1234-kgufwyh9-k6bak2:dbname=WorldCat > HTTP/1.1 > > In my httpd.conf file, I have tried several combinations of RewriteCond, > RewriteRule and ProxyPassMatch. > The sessionid is typically after the '?' and ProxyPassMatch doesn't find > it. > > The regular expression below will parse out the server and put it into > group $4 > /(WebZ)/(.*)(.*?sessionid=([^-]+)-1234)(.*)$ > > > For: > /WebZ/MEdit?sessionid=server09.prod-1234-kgv44z4b-pl2l93:editsessionid=2:catpage=html/corc/catalogue.html:entitymytemplateName=marc?sessionid=server09.prod-1234-kgv44z4b-pl2l93 > HTTP/1.1 > We would get: > Group 1. 5-9 WebZ > Group 2. 10-136 > MEdit?sessionid=server09.prod-1234-kgv44z4b-pl2l93:editsessionid=2:catpage=html/corc/catalogue.html:... > Group 3. 136-164 sessionid=server09.prod-1234 > Group 4. 146-159 server09.prod > Group 5. 164-189 -kgv44z4b-pl2l93 HTTP/1.1 > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org > For additional commands, e-mail: users-h...@httpd.apache.org > >