Fortinet Document Library

Version:


Table of Contents

User Guide

Download PDF
Copy Link

Custom block pages

You can customize the following pages that FortiWeb Cloud displays to your users:

  • The error page FortiWeb Cloud uses to respond to an HTTP request that violates a policy and the configured action is Deny or Period Block.
  • The "Server Unavailable!" page that FortiWeb Cloud returns to the client when none of the server pool members are available either because their status is Disable or Maintenance or they have failed the configured health check.
  • The Captcha enforcement pages that FortiWeb Cloud uses to differentiate between real users and automated users, such as bots.

Configuring a custom block page

Follow steps below to configure a custom block page:

  1. Go to Global > Custom Block Pages.
  2. Under the Messages tab, click Create New.
  3. Enter a name for the block page. The maximum length is 30 characters.
  4. Enter description for the block page. The maximum length is 512 characters
  5. Click the Edit icon for the message you want to edit.
  6. In the Edit Message window, the left side pane displays the source code, and the right side is how the message shows in the browser.
    It's not allowed to change the macros such as %%SOURCE_IP%%. See Macros in custom block pages.
  7. Click Save to save the changes of the message.
  8. If you want to edit other messages, click the Edit icon in their rows.
  9. Click OK to save the block page.
  10. To apply a block page for an application, select it in the Custom Block Pages list in Application > Network > Endpoints.

FortiWeb Cloud supports up to 8 custom block pages (including the predefined page).

Macros in custom block pages

All the macros and parameters in the HTML code can't be removed or edited, while the text that shows in the Web UI is allowed to be modified.

For example, in the following code, the macros (e.g. %%CAPTCHA_VCODE_STR%%) and parameters (e.g. req_data) can't be removed or edited, but the text "Security check" can be replaced with any text as you desire.

<input type="hidden" name="vcode" value="%%CAPTCHA_VCODE_STR%%">

<input type="hidden" name="req_data" value="%%CAPTCHA_REQ_DATA%%">

<h2>

Security check

</h2>

Adding images in custom block pages

The default block pages contain predefined images. To use your own images, you need to upload the image file, then insert image macro in the message body.

Uploading image files

  1. Go to Global > Custom Block Pages.
  2. Under the Images tab, Click Create New.
  3. Specify a name for the image file, select its type, and then click Choose File to browse to the file and select it.
    Ensure the image is no larger than 24 KB and that its type matches the value you have selected for Type.
  4. Click OK.

Inserting image file to messages

Use the following format to add an image macro anywhere in a custom block message:

%%IMAGE:<image_name>%%

where <image_name> is the name of the image you have uploaded.

For example, if you want to add the image test to the list of images, use %%IMAGE%%:test%% to add it to the HTML code.

h2.fgd_icon {

background: url(%%IMAGE:test%%)

width: 90px;

height: 92px;

margin: 48px auto;

}


Custom block pages

You can customize the following pages that FortiWeb Cloud displays to your users:

  • The error page FortiWeb Cloud uses to respond to an HTTP request that violates a policy and the configured action is Deny or Period Block.
  • The "Server Unavailable!" page that FortiWeb Cloud returns to the client when none of the server pool members are available either because their status is Disable or Maintenance or they have failed the configured health check.
  • The Captcha enforcement pages that FortiWeb Cloud uses to differentiate between real users and automated users, such as bots.

Configuring a custom block page

Follow steps below to configure a custom block page:

  1. Go to Global > Custom Block Pages.
  2. Under the Messages tab, click Create New.
  3. Enter a name for the block page. The maximum length is 30 characters.
  4. Enter description for the block page. The maximum length is 512 characters
  5. Click the Edit icon for the message you want to edit.
  6. In the Edit Message window, the left side pane displays the source code, and the right side is how the message shows in the browser.
    It's not allowed to change the macros such as %%SOURCE_IP%%. See Macros in custom block pages.
  7. Click Save to save the changes of the message.
  8. If you want to edit other messages, click the Edit icon in their rows.
  9. Click OK to save the block page.
  10. To apply a block page for an application, select it in the Custom Block Pages list in Application > Network > Endpoints.

FortiWeb Cloud supports up to 8 custom block pages (including the predefined page).

Macros in custom block pages

All the macros and parameters in the HTML code can't be removed or edited, while the text that shows in the Web UI is allowed to be modified.

For example, in the following code, the macros (e.g. %%CAPTCHA_VCODE_STR%%) and parameters (e.g. req_data) can't be removed or edited, but the text "Security check" can be replaced with any text as you desire.

<input type="hidden" name="vcode" value="%%CAPTCHA_VCODE_STR%%">

<input type="hidden" name="req_data" value="%%CAPTCHA_REQ_DATA%%">

<h2>

Security check

</h2>

Adding images in custom block pages

The default block pages contain predefined images. To use your own images, you need to upload the image file, then insert image macro in the message body.

Uploading image files

  1. Go to Global > Custom Block Pages.
  2. Under the Images tab, Click Create New.
  3. Specify a name for the image file, select its type, and then click Choose File to browse to the file and select it.
    Ensure the image is no larger than 24 KB and that its type matches the value you have selected for Type.
  4. Click OK.

Inserting image file to messages

Use the following format to add an image macro anywhere in a custom block message:

%%IMAGE:<image_name>%%

where <image_name> is the name of the image you have uploaded.

For example, if you want to add the image test to the list of images, use %%IMAGE%%:test%% to add it to the HTML code.

h2.fgd_icon {

background: url(%%IMAGE:test%%)

width: 90px;

height: 92px;

margin: 48px auto;

}