1
Apache Traffic Server Header Filter plugin
2
==========================================
4
This is a simple plugin for filtering out headers from requests (or
5
responses). Typical configuration is done either with a global
6
configuration, in .../etc/trafficserver/plugin.config:
8
header_filter.so /usr/local/etc/hdr_filters.conf
11
Or, alternatively, in a per-remap rule configuration
13
map http://a.com/ http://b.com @plugin=header_filter.so @pparam=hdr_filters.conf
16
Even if you don't have a global configuration, if your remap rules
17
schedules actions in hooks other than during remap, you must also add the
18
header_filter.so to the plugin.config (see above), but without args:
23
The configuration files looks like
34
X-Fie "Test" # Match the entire string
35
X-Foo /Test/ # Match the (Perl) regex
36
X-Bar [Test* # Match the prefix string
37
X-Fum *Test] # Match the postfix string
40
Comments are prefixed with #, and in most cases, the regular expression
41
matching is the best choice (very little overhead). The pattern matches
42
can also take an option '!' to reverse the test. The default action is
43
to delete all headers that do (not) match the pattern. E.g.
50
The final "i" qualifier (works on all pattern matches) forces the match or
51
comparison to be made case insensitive (just like in Perl).
54
It's also possible to replace or add headers, using the = and +
55
operators. For example
58
Host =www.example.com=
62
This will force the Host: header to have exactly one value,
63
www.example.com, while X-Foo will have at least one header with the value
64
ATS, but there could be more instances of the header from the existing
65
header in the request.
76
If not specified, the default hook to add the rules (headers to filter) is
77
READ_REQUEST_HDR. It's completely acceptable (and useful) to configure a
78
remap rule to delete headers in a later hook (e.g. when reading a response
79
from the server). This is what actually makes the plugin even remotely
93
should do it, assuming that you have the tsxs script in your search
94
path. This script is installed with your installation of Apache Traffic