Manual Chapter : Inserting Content in to HTML Pages

Applies To:

Show Versions Show Versions


  • 17.1.0, 17.0.0, 16.1.4, 16.1.3, 16.1.2, 16.1.1


  • 17.1.0, 17.0.0, 16.1.4, 16.1.3, 16.1.2, 16.1.1, 16.1.0
Manual Chapter

Inserting Content in to HTML Pages

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

Before you can insert content in to the HTML pages, on the BIG-IP system, you need to create an enforcement policy and add rules to an enforcement policy. You can add the content action as one of the actions to the existing list of actions supported by PEM. You can also control the insertion frequency through configuration per transaction.
The size of the content being inserted cannot be more than 65k letters.
  1. On the Main tab, click
    Policy Enforcement
    The Policies screen opens.
  2. Click the name of the enforcement policy you want to add rules to.
    The properties screen for the policy opens.
  3. In the Policy Rules area, click
    The New Rule screen opens.
  4. In the
    field, type a name for the rule.
  5. In the
    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 precedence.
    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.
  6. Use the Classification, URL, Flow, and Custom Criteria tabs to identify the traffic that you want to be affected by this rule.
  7. From the
    Insert Content
    list, select
    , to modify the content insertion.
    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.
  8. To insert content, select the action you want to implement.
    • From the
      list, select
      to prepend (opening and closing) the HTTP tag. Specify the tag name from the
      HTTP Tag
    • From the
      list, select
      to append (opening and closing) the HTTP tag. Specify the tag name from the
      HTTP Tag
  9. In the
    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:
      is triggered when a policy evaluation occurs.
      runs the first time the iRule is loaded or has changed.
    The two new PEM iRule commands are
    PEM::policy initial
    PEM::policy name
    . You can select the
    Wrap Text
    check box to wrap the definition text, and select the
    Extend Text Area
    check box to increase the field space of format scripts.
  10. From the
    list, select a frequency type.
    • Select
      to insert content in each transaction.
    • Select
      to insert content once per action.
    • Select
      Once Every
      to insert content once per designated time period, in seconds.
  11. Click
  12. On the Main tab, click
    Policy Enforcement
    The Global Options screen opens.
  13. For the
    Content Insertion Options
    setting, in the
    fields, type the time used to set the maximum wait time before Policy Enforcement Manager applies the insert action again on the same subscriber.
    The insert actions do not conflict with each other.
You have inserted content in to the HTML pages.