How to Create a Customized Error Page with Variables for NetScaler Application Firewall

How to Create a Customized Error Page with Variables for NetScaler Application Firewall

book

Article ID: CTX140293

calendar_today

Updated On:

Description

This article describes how to create a customized error page with variables for NetScaler Application Firewall.

Background

The error pages can be customized to return the following data:

  • Transaction ID - ${NS_TRANSACTION_ID}: The transaction ID which the Application Firewall assigned to this transaction.

  • Session ID - ${NS_APPFW_SESSION_ID}: The Application Firewall session ID.

  • Violation Category - ${NS_APPFW_VIOLATION_CATEGORY}: The specific Application Firewall security check or rule that was violated.

  • Violation Log - ${NS_APPFW_VIOLATION_LOG}: The detailed error message associated with the violation.

  • Session Cookie - ${COOKIE("<CookieName>")}: The contents of the specified cookie. For <CookieName>, substitute the name of the specific cookie that you want to display on the error page.


Instructions

To customize the error page, complete the following steps:

  1. Go to Application Firewall > Imports, and click Add.

  1. Copy and paste the following example error page contents in the Import window and save the error page:

    Or

    Save the contents as a file and import the file using Load button in the Import dialog.

    Example error page contents:

    <html>
    <title> Customized Error Page </title>
    <body>
    Parameters in the customized error page:<br>
    Transaction ID = ${NS_TRANSACTION_ID}
    Session ID = ${NS_APPFW_SESSION_ID}
    Violation Category = ${NS_APPFW_VIOLATION_CATEGORY}
    Violation Log = ${NS_APPFW_VIOLATION_LOG}
    Session Cookie : ${COOKIE("citrix_ns_id")}
    </body>
    </html>

Import a new HTML Error Page

  1. Apply the error page to the profile from the Settings tab.

Apply the error page to the profile from the Settings tab.

Issue/Introduction

This article describes how to create a customized error page with variables for NetScaler Application Firewall

Additional Information

For another example HTML error page that uses custom variables, refer to this Citrix Documentation.