To do this without a plugin you just need to make the last map line not "/". If the last map line where a domain & path match, then the request to http://service.domain.com would get to the redirect. Not sure if that will work for you or not, but figured I'd point it out :)
On Fri, Apr 17, 2015 at 7:09 AM, Christian HUTTER <[email protected]> wrote: > Hi, > > using the header rewrite plugin works perfectly. Thank you very much for > the help! > > Have a nice weekend > > Christian > > ------------------------------------------------------------- > Christian Hutter ([email protected]) > Service Informatique Université > University of Luxembourg > > > > On 17 Apr 2015, at 11:19, Sudheer Vinukonda <[email protected]> > wrote: > > The reason match all mapping is matched ahead of the redirect rule is > due to the precedence order for map rules vs redirect rules. > > > https://docs.trafficserver.apache.org/en/latest/reference/configuration/remap.config.en.html#precedence > > But the precedence rules does bring up a problem in that, like you > noticed the match-all rule effectively results in ignoring any > redirect/reverse_map rules ahead of it. This is perhaps something that > could (should?) be enhanced/fixed. > > In the mean time, for your specific issue, you may use the > header_rewrite plugin to do the redirect for http (see an example below): > > $cat remap.config > > map http://service.domain.com/ https://this-is-a-non-existent-domain.com/ > @plugin=header_rewrite.so @pparam=header_rewrite.config > map https://service.domain.com https://servera.domain.com > map / http://default.domain.com/ > > > $cat header_rewrite.config > > %cond {READ_REQUEST_PRE_REMAP_HOOK} > set-redirect 301 https://service.domain.com [L] > > > Thanks, > > Sudheer > > ------------------------------ > *From:* Christian HUTTER <[email protected]> > *To:* "[email protected]" <[email protected]> > *Sent:* Friday, April 17, 2015 12:01 AM > *Subject:* Mixing redirect and match-all in remap.config > > Hi, > > I’m facing a problem with ats 5.2.1 as reverse proxy and redirects in > combination with a match all mapping. My configuration in remap.config is > as follows: > > redirect http://service.domain.com/ https://service.domain.com/ > map https://service.domain.com https://servera.domain.com > map / http://default.domain.com/ > > If I try to access https://service.domain.com it works as supposed > showing me the page on servera. But accessing http://service.domain.com > does not redirect to https but shows me the page on default.domain.com. > As soon as I comment out the catch-all map rule the redirection rule works. > > Could someone please explain to me how to have redirect and catch-all? > > Thank you for your help. > > > Greetings > > Christian > > ------------------------------------------------------------- > Christian Hutter ([email protected]) > Service Informatique Université > University of Luxembourg > > > > >
