Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Smart Web Security
  • Getting started
    • All guides
    • Address lists
      • Creating a template
      • Adding a template to a profile or rule
      • Managing a template
    • Viewing operations
    • Configuring monitoring
    • Setting up alerts
    • Configuring logs via Smart Web Security
    • Configuring logs via Application Load Balancer
    • Migrating to WAF with support for Yandex rules
    • Overview
    • Security profiles
    • WAF
    • ARL (request limit)
    • Rules
    • Conditions
    • Lists
    • Managing bot traffic
    • Protecting domains
    • Response templates
    • Logging
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Response templates
  3. Creating a template

Creating a response page template

Written by
Yandex Cloud
Updated at February 24, 2026
Management console
  1. In the management console, select the folder where you want to create the template.

  2. Go to Smart Web Security.

  3. In the left-hand panel, select Response templates and click Create template.

  4. Enter the Page name, which is the name of the file returned in response to the client request.

    The name must be between 1 to 50 characters long and may contain lowercase Latin letters, numbers, hyphens, underscores, and periods. The first character must be a letter or number.

  5. Optionally, provide a template description.

  6. Select a Response code, i.e., one of the standard HTTP response codes for which the client will get a page based on your template.

  7. Select the Response format: HTML, JSON, XML, or Custom.

    Each format has a matching HTTP Content-Type header: text/html, application/json, or application/xml. For a custom header, select Custom.

  8. For the Custom format, enter Content-Type, e.g., text/plain.

  9. Optionally, to add an HTTP header, click Add response header and specify its parameters:

    • Key: HTTP header name, e.g., User-Agent, Host.
    • Value: For example, Mozilla/5.0 (...), example.com.

    You can add up to 10 headers. You cannot add Content-Type and Content-Length headers, you can only set Content-Type in a separate field for the Custom format.

  10. Enter the Response body, i.e., the page content the client will get as a response. The response must not exceed 2 KB (about 2,000 UTF-8 characters) in size.

    The content of the response must match the selected response format, for example:

    • HTML

      <!doctype html>
      <html lang="ru">
      <head><meta charset="utf-8"><title>403 Forbidden</title></head>
      <body><h1>403 Forbidden</h1><p>Access restricted.</p></body>
      </html>
      
    • JSON

      {
      "error": {
          "code": 403,
          "message": "Access restricted.",
          "details": "Not enough permissions to perform the operation."
      }
      }
      
    • XML

      <?xml version="1.0" encoding="UTF-8"?>
      <error>
      <code>403</code>
      <message>Access restricted.</message>
      <details>Not enough permissions to perform the operation.</details>
      </error>
      
  11. Optionally, add other parameters to the response body by selecting the relevant preset: Request ID, Client IP address, Request time.

    This data may be useful when the client contacts support.

    Example of a page with optional parameters:

    <html>
    <head><title>403 Forbidden</title></head>
    <body>
    <h1>403 Forbidden</h1>
    <p>Access restricted. If you should have access, provide the following details to support:</p>
    <p>ID: %unique_key%</p>
    <p>IP address: %client_ip%</p>
    <p>Request time: %request_time%</p>
    <p>Contacts: security@example.com</p>
    </body>
    </html>
    
  12. To view the final page on the client side, click Preview at the top right.

  13. Click Create.

See alsoSee also

  • Adding a response page template to a profile or rule
  • Response page templates

Was the article helpful?

Previous
Address lists
Next
Adding a template to a profile or rule
© 2026 Direct Cursus Technology L.L.C.