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.configmap 
https://service.domain.com https://servera.domain.commaphttp://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
   
 <!--#yiv6622835872 _filtered #yiv6622835872 {font-family:"Cambria 
Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv6622835872 
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv6622835872 
#yiv6622835872 p.yiv6622835872MsoNormal, #yiv6622835872 
li.yiv6622835872MsoNormal, #yiv6622835872 div.yiv6622835872MsoNormal 
{margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", 
sans-serif;}#yiv6622835872 a:link, #yiv6622835872 
span.yiv6622835872MsoHyperlink 
{color:#0563C1;text-decoration:underline;}#yiv6622835872 a:visited, 
#yiv6622835872 span.yiv6622835872MsoHyperlinkFollowed 
{color:#954F72;text-decoration:underline;}#yiv6622835872 
span.yiv6622835872EmailStyle17 {font-family:"Calibri", 
sans-serif;color:windowtext;}#yiv6622835872 .yiv6622835872MsoChpDefault 
{font-size:10.0pt;font-family:"Calibri", sans-serif;} _filtered #yiv6622835872 
{margin:72.0pt 72.0pt 72.0pt 72.0pt;}#yiv6622835872 
div.yiv6622835872WordSection1 {}-->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 
accessinghttp://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    

  

Reply via email to