Applies To:Show Versions
- 14.0.1, 14.0.0, 13.1.4, 13.1.3, 13.1.1, 13.1.0
Overview: Inserting content into HTML pages
You can use the Policy Enforcement Manager™ (™PEM) for header modifications by configuring insertion of content into HTML web pages, based on a PEM policy. The content inserted can be a string or TCL script, and can occur in the beginning, middle, or end of the HTML page.
Insertion of content is useful in these scenarios:
- To insert tailor made ads to certain subscribers based on profiles.
- For sending alerts to the subscriber when the usage quota is reached.
- For periodically sending the subscriber usage statistics.
PEM inserts the content at the match tag, and, depending on the throttling level, implements:
- If the content needs to be inserted once per subscriber.
- Periodic insertions into the transactions, which matches the criteria. (You can configure the periodic timer.)
- Insertion in all the transactions matching the action.
Configuring content insertion for policy action
On the Main tab, click
. The Policies screen opens.
Click the name of the enforcement policy you want to add rules to.
The properties screen for the policy opens.
In the Policy Rules area, click Add.
The New Rule screen opens.
- In the Name field, type a name for the rule.
In the Precedence field, type an integer that indicates the
precedence for the rule in relation to the other rules. Number 1 has the highest
precedence. Rules with higher precedence are evaluated before other rules with lower
Tip: All rules in a policy are run concurrently. Precedence takes effect when there are conflicting rules. The conflict occurs when the traffic matches two rules and the policy actions from these rules differ. For example, if you have rule 1 with precedence 10 and Gate Status disabled for a search engine, and you have rule 2 with precedence 11 and Gate Status enabled, then rule 1 is processed first because it has higher precedence. Rules conflict if they have identical or overlapping classification criteria (for the traffic that matches more than one rule). In some cases, different policy actions are not conflicting, and hence, applied in parallel.
- Use the Classification, URL, Flow, and Custom Criteria tabs to identify the traffic that you want to be affected by this rule.
From the Insert Content list, select
Enabled, to modify the content insertion.
Note: The BIG-IP system does not allow matching tags that are inserted, by insert action, on a given flow.More content insertion configuration options display.
To insert content, select the action you want to implement.
- From the Position list, select Before to prepend (opening and closing) the HTTP tag. Specify the tag name from the HTTP Tag list.
- From the Position list, select After to append (opening and closing) the HTTP tag. Specify the tag name from the HTTP Tag list.
In the Type field, type the string that defines the content, or
the TCL script, which can be later attached to a policy enforcement rule.
HTTP::header replace Server \"Nginx\"There can be two iRule events:
- PEM_POLICY is triggered when a policy evaluation occurs.
- RULE_INIT runs the first time the iRule is loaded or has changed.
From the Frequency list, select a frequency type.
- Select Always to insert content in each transaction.
- Select Once to insert content once per action.
- Select Once Every to insert content once per designated time period, in seconds.
- Click Finished.
On the Main tab, click
. The Global Options screen opens.
For the Content Insertion Options setting, in the
Throttling fields, type the time used to set the maximum wait
time before Policy Enforcement Manager™ applies the insert action
again on the same subscriber.
Note: The insert actions do not conflict with each other.