Leif ,

 

We assume that has not matching regex  value so thats have problem on our side .  So We  try regex on debug mode and would make the new regex .

/DAI/(.*STB.m3u8[?])   http://secondary.origin:port/$1$q  @status=302

/DAI/(.*STB.mpd[?])   http://secondary.origin:port/$1$q  @status=302

 

Seems it has been working but not tested in production. If anything  I would post here. Thanks for your reply  , hope more helpful for your advice .

 

__Vasanth

 

Sent from Mail for Windows 10

 

From: Leif Hedstrom
Sent: Wednesday, May 15, 2019 2:20 AM
To: Mailing-List trafficserver
Subject: Re: Need allow only query string in hdr_rewrite/regex_remap

 



On May 14, 2019, at 8:46 AM, Vasanth Mathivanan <vasanth.m@evolutiondigital.com> wrote:

Leif ,
 
1.Not sure this is correct or not (id=* ).We mean this value contains any hash values to redirect the all
requests.   

Id assume its not. The above would match e.g. ?id======  but not ?id=1234.

 
2.yes , only query string value need to be redirect, not others.

Why dont you show the full rules / config file ? Seeing that you are using regular expressions wrong, maybe there are other issues in it as well.

 
3.Here the  remap rule config:
 
map   http://atsserver:port   http://primary.origin:port  @plugin=regex_remap.so @pparam=maps.reg@plugin=header_rewrite.so @pparam=hdr_rw_live.config  @plugin=header_rewrite.so @pparam=dscp/set_dscp_32.config  plugin=collapsed_forwarding.so @plugin=cache_range_requests.so  
 


regex_remap is the right solution here, you just have to configure it correctly.

Leif

 
 
Thanks,
 
__Vasanth
 
 
Sent from Mail for Windows 10
 
From: Leif Hedstrom
Sent: Tuesday, May 14, 2019 7:59 PM
To: users@trafficserver.apache.org
Subject: Re: Need allow only query string in hdr_rewrite/regex_remap
 
 


On May 14, 2019, at 05:36, Vasanth Mathivanan <vasanth.m@evolutiondigital.com> wrote:

Hi All , 
 
Actually we are using to get m3u8 and mpd based on Live streaming via ATS. Now we need to implement DAI for IP TV solutions. We tried a lot , our requirements are contains any query string on mpd/m3u8  will redirect to another server,  without query string go to the remap origin directly. And one more thing  first m3u8 only had query string not next to the file, it should be  go directly which is the remap origin but only first m3u8 wants to be redirect .
 

In maps.reg contains , 

^/DAI/(.*)?id=*         http://secondary.origin:port/DAI/$1 @status=302
 
 
First l, this is not the correct regular expression, Im pretty sure you mean
 
    ?id=.*
 
Secondly, do you have a regex matching all other URLs in this same config file?
 
Third, can you show the actual rule you put in remap.config?
 
Ciao,
 
Leif 


It has been enabled plugin in remap config.
 
We have to tried another method,

cond %{CLIENT-URL:QUERY}  [AND]
cond %{STATUS} >199 [AND]
cond %{STATUS} <500
set-redirect 302 http://secodary.origin/DAI/MIS22/STB.m3u8 [QSA]

But above header rewrite function has problem , each request will be redirected .

Client URL like this :

http:// secodary.origin :port/DAI/MIS22/STB.m3u8?id=7965a61adfc2ec62dead23a037e451e13a50c -wants to be redirect .
 
http:// secodary.origin :port/DAI/MIS22/video.m3u8 normal request go to remap origin.
 
 
Please anyone give the solution for me.


Thanks 

__Vasanth

 




Sent from Mail for Windows 10