This article describes how to create a customized error page with variables for NetScaler Application Firewall.
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.
To customize the error page, complete the following steps:
Go to Application Firewall > Imports, and click Add.
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>

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

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