Hi, The document is updated. And an example is added in the document.
Thanks, Jifeng On 06/12/2016, 19:41, "Jifeng Yang (jifyang)" <jify...@cisco.com> wrote: JvD: I did test the PATH_REGEX in Traffic Router. It works. About the disk-vs-RAM question, I think both of you are right. About the approach of merging regex lines from multi delivery services into one regex config file, there will be some issues (such as interfere with user defined regexes in multi delivery services, the order of the regexes). And as a feature of Traffic Control, I think it’s better can be used for general cases. Thanks, Jifeng On 06/12/2016, 00:40, "Jan van Doorn" <j...@knutsel.com> wrote: Jifeng: did you actually test that match-type: PATH works in Traffic Router? We've never used it... Eric: I think you are right wrt RAM vs disk; Only way to do this right now is to set up one of them to point to a CNAME and have 2 deliveryservices, but they wouldn't be able to have the edge URL.... I'm OK with doing it your way, I think, we just have to add really good docs. Maybe a quick howto on how to provision your example scenario? Cheers, JvD > On Dec 5, 2016, at 06:49, Eric Friedrich (efriedri) <efrie...@cisco.com> wrote: > > To use regex_remap, I think we would want just a single line in remap.config that covers all delivery services with the same host regex. This would be a change from today where every DS gets one remap line. Instead, we would need to combine multiple DS into one remap line with multiple lines in a regex_remap_<n>.config > > remap.config > map http://traffic-server.sports.ipcdn.com/ <http://traffic-server.sports.ipcdn.com/> http://origin.server.com/ <http://origin.server.com/> @plugin=regex_remap.so @pparam=regex_remap_ds_1.config > > regex_remap_ds_1.config: > ^/vod/.* http://origin.server.com/$0 <http://origin.server.com/$0> > ^/live/.* http://origin.server.com/$0 <http://origin.server.com/$0> > > Seems like lots of work in Traffic Ops just to restrict URLs outside of /vod and /live. If desired, could that restriction instead be done as a custom header rewrite rule? > > > A second question: How will this change separate these two delivery services live and vod onto different storage volumes? > Hosting.config is based on the remapped origin server - in both cases this is origin.server.com <http://origin.server.com/><http://origin.server.com <http://origin.server.com/>>, so there is no way to differentiate the two delivery services into being stored on disk vs in RAM. > > Thanks, > Eric > > > > > > On Dec 5, 2016, at 6:47 AM, Jifeng Yang (jifyang) <jify...@cisco.com <mailto:jify...@cisco.com><mailto:jify...@cisco.com <mailto:jify...@cisco.com>>> wrote: > > Yes, Traffic Router source code doesn’t need change. To make PATH_PREFIX work correctly, the configuration for Traffic Router needs change. > > For example, if the HOST_REGEX is ".*\.sports\..*", the Traffic Router configuration file “cr-config.json” will contains: > > "matchlist": [{ > "regex": ".*\\.sports\\..*", > "match-type": "HOST" > }] > > If a path_prefix “/path/” is added, the above item will be changed to: > > "matchlist": [ > { > "regex": ".*\\.sports\\..*", > "match-type": "HOST" > }, > { > "regex": "^/path/.*", > "match-type": "PATH" > } > ] > > So, with this configuration Traffic Router will not redirect the request whose path prefix is not “/path/”. > > As the solution with PATH_REGEXP and regex_remap, there is no issue for traffic router, but there is problem for ATS. > > The ATS remap.config file does not support regex directly, only supports path prefixes. So, the PATH_REGEXP can't be used as a remap rule in remap.config directly. To work with PATH_REGEXP, a possible way is using the remap plugin. But there are some issues for this, such as: > > * if two delivery services with same domain name, the remap config file will look like: > > map http://traffic-server.sports.ipcdn.com/ http://origin.server.com/ @plugin=regex_remap.so @pparam=regex_remap_ds_1.config … > map http://traffic-server.sports.ipcdn.com/ http://origin.server.com/ @plugin=regex_remap.so @pparam=regex_remap_ds_2.config … > > ATS doesn’t work with this kind of remap config file. > > * If implemented by regex_remap, a regex expression will be generated for a delivery service. The user also can configure "Regex remap expression" for a delivery service. If user also configure a regex expression, they may interfere with each other. > > Thanks, > Jifeng > > > On 01/12/2016, 23:23, "Jan van Doorn" <j...@knutsel.com <mailto:j...@knutsel.com><mailto:j...@knutsel.com <mailto:j...@knutsel.com>>> wrote: > > So for your example you would enter 2 delvieryservices with the same host_regex (which would be possible because you drop the unique requirement on it), different path prefixes and have different settings for each? > > I think I get that.... ? > > I _think_ this would work without changing Traffic Router (it just tags on the path in the redirect)... 3.3 in the doc says Traffic Router will be changed as well, but I don't see that in the PR? > > Also, going back to my initial question - did you consider implementing this with PATH_REGEXP and regex_remap? > > Rgds, > JvD > > > On Dec 1, 2016, at 07:35, Jifeng Yang (jifyang) <jify...@cisco.com <mailto:jify...@cisco.com><mailto:jify...@cisco.com <mailto:jify...@cisco.com>>> wrote: > > Hi JvD, > > The difference between the two is: the former doesn’t serve the content under the paths other than “/vod/” and “/live/”. > > For example, for the request “http://traffic-server.sports.ipcdn.com/path/file <http://traffic-server.sports.ipcdn.com/path/file>”, the former doesn’t serve it while the latter does serve it. > > Regarding the use case, this is useful if: > > Under the same domain name, the contents under some paths are set by one configuration and the contents under some other paths are set by another configuration. > > For example, > > Different “Regex remap expression” can be configured for “http://traffic-server.sports.ipcdn.com/vod/ <http://traffic-server.sports.ipcdn.com/vod/>” and “http://traffic-server.sports.ipcdn.com/live/ <http://traffic-server.sports.ipcdn.com/live/>”. > > Different traffic caches can be assigned for “http://traffic-server.sports.ipcdn.com/vod/ <http://traffic-server.sports.ipcdn.com/vod/>” and “http://traffic-server.sports.ipcdn.com/live/ <http://traffic-server.sports.ipcdn.com/live/>”. > > Some different configuration items become possible because separated delivery services. > > Thanks, > Jifeng > > > On 30/11/2016, 23:23, "Jan van Doorn" <j...@knutsel.com <mailto:j...@knutsel.com><mailto:j...@knutsel.com <mailto:j...@knutsel.com>>> wrote: > > Hi Jifeng, > > I'm still confused, bear with me please. > > The Google doc example has > > map http://traffic-server.sports.ipcdn.com/vod/ <http://traffic-server.sports.ipcdn.com/vod/> http://origin.server.com/vod/ <http://origin.server.com/vod/> > map http://traffic-server.sports.ipcdn.com/live/ <http://traffic-server.sports.ipcdn.com/live/> http://origin.server.com/live/ <http://origin.server.com/live/> > > > But, isn't that the same as > > map http://traffic-server.sports.ipcdn.com/ <http://traffic-server.sports.ipcdn.com/> http://origin.server.com/ <http://origin.server.com/> > > ? > > If you want to send the /live to RAM and the /vod to disk, they can't be in the same deliveryservice table entry, since all those type if things are set there? > > Can you elaborate on the use case you are trying to solve? > > Rgds, > JvD > > On Nov 30, 2016, at 04:16, Jifeng Yang (jifyang) <jify...@cisco.com <mailto:jify...@cisco.com><mailto:jify...@cisco.com <mailto:jify...@cisco.com>>> wrote: > > Hi, > > Different delivery services can be configured with different domain names now. In some cases, different delivery services with same domain name and different path prefixes are needed. These delivery services can have different configurations. > > The problem and a solution are described in the document https://docs.google.com/document/d/19-TZ6ODla_vdiYqZajbpRiOpLvpbJxil1SvIm44zb-0/edit?usp=sharing. > > The issue and PR for this: > Issue: https://issues.apache.org/jira/browse/TC-55?jql=project%20%3D%20TC > PR: https://github.com/apache/incubator-trafficcontrol/pull/108 > > Thanks, > Jifeng