The statements discussed in this subsection modify incoming requests prior
to passing them to the backend. These same set of statements can also
be used in Service section (see Service). When
appearing in both sections, the directive from ListenHTTP
(ListenHTTPS) section are applied first, followed by
directives from the Service section. Directives from the same
section are applied in order of their appearance.
Run Lua function func with supplied arguments. The function is supposed to modify the request.
The func can be either an unqualified function name, or function
name with module qualifier (module.func).
Each arg is subject to to backreference expansion and request accessor interpretation, as discussed in Request modifications.
This statement is available only if pound was built with Lua
support. See Changing requests and responses in Lua, for a detailed discussion.
If set to ‘true’, the Destination: request header will be
changed to point to the backend with the correct protocol.
Set the URL of the incoming request to url.
Set the path part of the URL to the given string. If -encode option is given, the value will be percent-encoded prior to setting it.
Set the query part of the URL to the given string. Value must be a valid query with the special characters properly encoded using percent encoding.
Delete query part of the URL.
Used with two arguments, sets query parameter name to the value. If -encode is given, value will be percent-encoded prior to being assigned to the parameter. Otherwise, it will be assigned verbatim. The -encode option is allowed before name argument as well.
Used with one argument, deletes the parameter name.
Sets the HTTP header. If the header name already exists, it will be overwritten. Otherwise, new header will be added to the end of the header list.
The HeaderAdd and AddHeader forms are retained for
backward compatibility with earlier pound versions. You are
advised against using them.
Remove from the request all headers matching pattern. The
HeaderRemove and HeadRemove forms are retained for
backward compatibility with earlier pound versions. You are
advised against using them.
By default, pattern is treated as extended POSIX regular expression. The options argument can be used to alter this. It consists of zero or more option flags from the following list:
| Flag | Meaning |
|---|---|
-beg | Exact match at the beginning of string (prefix match). |
-case | Case-sensitive comparison. |
-contain | Delete each header where "pattern" is a substring. |
-end | Exact match at the end of string (suffix match). |
-exact | Use exact string match. |
-icase | Case-insensitive comparison. |
-pcre | Use Perl-compatible regular expression. see Regular Expressions. |
-perl | Same as -pcre.
|
-posix | Use POSIX extended regular expression. see Regular Expressions. |
-re | Use regular expression match. This assumes the
default regular expression type, as set by the RegexType
directive (see Regular Expressions). |
Table 11.1: Header matching flags for DeleteHeader directive
The following options are mutually exclusive: -beg,
-contain, -end, -exact, -pcre (-perl),
-posix, -re. If more than one of these are used, the
last one takes effect.