You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/12/10 18:07:22 UTC

[1/2] git commit: Document the remap.config '.include' directive

Updated Branches:
  refs/heads/master a2c2ded90 -> 8b6ab74d6


Document the remap.config '.include' directive


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8b6ab74d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8b6ab74d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8b6ab74d

Branch: refs/heads/master
Commit: 8b6ab74d6eb099674dc4d101297699459abcca65
Parents: 49111ee
Author: James Peach <jp...@apache.org>
Authored: Fri Dec 6 16:36:14 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Dec 10 09:05:31 2013 -0800

----------------------------------------------------------------------
 doc/reference/configuration/remap.config.en.rst | 53 +++++++++++++++++++-
 1 file changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8b6ab74d/doc/reference/configuration/remap.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/remap.config.en.rst b/doc/reference/configuration/remap.config.en.rst
index fa2713d..b6223da 100644
--- a/doc/reference/configuration/remap.config.en.rst
+++ b/doc/reference/configuration/remap.config.en.rst
@@ -284,7 +284,9 @@ Examples
 
 ::
 
-    map http://url/path http://url/path @plugin=/etc/traffic_server/config/plugins/plugin1.so @pparam=1 @pparam=2 @plugin=/etc/traffic_server/config/plugins/plugin2.so @pparam=3
+    map http://url/path http://url/path \
+        @plugin=/etc/traffic_server/config/plugins/plugin1.so @pparam=1 @pparam=2 \
+        @plugin=/etc/traffic_server/config/plugins/plugin2.so @pparam=3
 
 will pass "1" and "2" to plugin1.so and "3" to plugin2.so.
 
@@ -324,3 +326,52 @@ The filter `disable_delete_purge` will be applied to all of the
 mapping rules. (It is activated before any mappings and is never
 deactivated.) The filter `internal_only` will only be applied to the
 second mapping.
+
+Including Additional Remap Files
+================================
+
+The ``.include`` directive allows mapping rules to be spread across
+multiple files. The argument to the ``.include`` directive is a
+list of file names to be parsed for additional mapping rules. Unless
+the names are absolute paths, they are resolved relative to the
+Traffic Server configuration directory.
+
+The effect of the ``.include`` directive is as if the contents of
+the listed files is included in the parent and parsing restarted
+at the point of inclusion. This means that and filters named in the
+included files are global in scope, and that additional ``.include``
+directives are allowed.
+
+.. note::
+
+  Included remap files are not currently tracked by the configuration
+  subsystem. Changes to included remap files will not be noticed
+  by online configuration changes applied by :option:`traffic_line
+  -x` unless :file:`remap.config` has also changed.
+
+Examples
+--------
+
+In this example, a top-level :file:`remap.config` file simply
+references additional mapping rules files ::
+
+  .include filters.config
+  .include one.example.com.config two.example.com.config
+
+The file `filters.config` contains ::
+
+  .definefilter deny_purge @action=deny @method=purge
+  .definefilter allow_purge @action=allow @method=purge
+
+The file `one.example.com.config` contains::
+
+  .activatefilter deny_purge
+  map http://one.example.com http://origin-one.example.com
+  .deactivatefilter deny_purge
+
+The file `two.example.com.config` contains::
+
+  .activatefilter allow_purge
+  map http://two.example.com http://origin-two.example.com
+  .deactivatefilter dallowpurge
+


[2/2] git commit: update regex remap docs

Posted by jp...@apache.org.
update regex remap docs


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/49111ee8
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/49111ee8
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/49111ee8

Branch: refs/heads/master
Commit: 49111ee87aba994548cf06be7d4255719cefb2f7
Parents: a2c2ded
Author: James Peach <jp...@apache.org>
Authored: Wed Dec 4 20:16:55 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Dec 10 09:05:31 2013 -0800

----------------------------------------------------------------------
 doc/reference/plugins/regex_remap.en.rst | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49111ee8/doc/reference/plugins/regex_remap.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/regex_remap.en.rst b/doc/reference/plugins/regex_remap.en.rst
index a98107b..0b8bb70 100644
--- a/doc/reference/plugins/regex_remap.en.rst
+++ b/doc/reference/plugins/regex_remap.en.rst
@@ -27,12 +27,15 @@ To use this plugin, configure a remap.config rule like ::
 
     map http://a.com http://b.com @plugin=regex_remap.so @pparam=maps.reg
 
-The parameter with the file name is always required, and the regular
-expressions within are evaluated sequentially from the first to the
-last. When a regular expression is positively matched against a request
-URL, evaluation is stopped and the rewrite rule is applied. If none of
-the regular expressions are a match, the default destination URL is
-applied (``http://b.com`` in the example above).
+The file name parameter is always required. Unless an absolute path
+is specified, the file name is assumed to be a path relative to the
+Traffic Server configuration directory.
+
+The regular expressions listed in the configuration file are evaluated
+sequentially. When a regular expression is positively matched against
+a request URL, evaluation is stopped and the rewrite rule is applied.
+If none of the regular expressions are a match, the default destination
+URL is applied (``http://b.com`` in the example above).
 
 An optional argument (``@pparam``) with the string "``profile``\ " will
 enable profiling of this regex remap rule, e.g. ::
@@ -66,7 +69,6 @@ like ::
 
     GET/path?query=bar
 
-
 The methods are always all upper-case, and always followed by one single
 space. There is no space between the method and the rest of the URL (or
 URI path).
@@ -81,11 +83,6 @@ the option 'matrix-parameters', e.g. ::
 
     ... @pparam=maps.reg @pparam=matrix-parameters
 
-The config file (``maps.reg`` above) can be placed anywhere, but unless
-you specify an absolute path (as above), it will default to ::
-
-    /usr/local/etc/regex_remap
-
 A typical regex would look like ::
 
     ^/(ogre.*)/more     http://www.ogre.com/$h/$0/$1
@@ -110,6 +107,12 @@ on the right hand side during evaluation ::
     $c     - The cookie string from the request
     $i     - The client IP for this request
 
+.. note::
+
+    The ``$0`` substitution expands to the characters that were
+    matched by the regular expression, not to the entire string that
+    the regular expression was matched against.
+
 You can also provide options, similar to how you configure your
 remap.config. The following options are available ::