Skip to main content

Custom Pages

The custom pages in the Arvancloud CDN Service allow you to substitute or personalize different pages of your website, such as Error Pages or Under Construction Pages. These pages are displayed in Arvancloud’s default design. Still, you can upload HTML files or URLs to redirect your visitors to another page to improve the user experience of your website.

Go to the Custom Pages of your Arvancloud user panel under the CDN section to manage these pages.

Here, you can choose to use the default page or substitute another one for the Error Page or Under Construction Page. Choosing the option of Upload HTML means that you can upload your HTML file.

Also, if you need your users to be redirected to another page instead, you can choose the Redirect option.

To start building your page, you can use the following custom error template on all pages:

<html>

<head></head>

<body>

%desired variable%

</body>

</html>

Keep in mind that all external resources such as images, CSS, and scripts included in your file must be accessible (i.e. return an OK 200 response) or an error will occur.

For example, if the image file you are using is on your domain and you have banned access from a geographic region at the entire domain level, you must customize the path of your static files so that firewall rules are not applied to it, or use Arvancloud's object storage.

The following table lists the variables that can be used to display on the error, update or DDoS protection pages:

ParameterDescription
%IP%Shows user IP address.
%SID%Shows the server id the user has been connected to.
%DOMAIN%Shows requested domain.
%ERRCODE%Shows error code.
%TIME%Shows timestamp of error in the form of: %Y-%m-%d %H:%M:%S %Z.
%REQUEST_ID%Shows request id.
%Challenge%It calls DDoS Protection challenges dynamically

In the image below you can see some of the above values in a 403 error page.

Finally, click on Save to apply the changes.

Under Construction Pages

With this feature, you can choose which page your visitors will be shown when the website is under maintenance. In other words, the page that your visitors see when the website is updated can be adjusted in this field.

Note that by setting any of the (Upload HTML) or (Redirect) methods, the "Under Maintenance" mode is activated and applied to the entire domain.

Setting a "Custom Page" for the Under Construction page using the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY ' \

--header 'cache-control: no-cache' \

--form 'file=@"/C:/Users/arvan/Desktop/example.html"' \

--form 'page="under_construction"' \

--form 'type="file"'

Setting the "Redirect" for the Under Construction page using the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'page="under_construction"' \

--form 'url="https://example.com/uc.html"' \

--form 'type="url"'

Error 500

This error message indicates that the website's main server is temporarily unavailable. Arvancloud displays this message by default when the origin server returns one of the 500, 502, 503 or 504 errors.

In this situation, users will encounter an error similar to the following image:

Set "Redirect" for errors connecting to the main server using the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'page="error_500"' \

--form 'url="https://example.com/500"' \

--form 'type="url"'

"Upload HTML for errors connecting to the main server using the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'file=@"/C:/Users/arvan/Desktop/example.html"' \

--form 'page="error_500"' \

--form 'type="file"'

Custom Template for DDoS Protection Challenges

By activating one of the JS or Captcha challenges, a page will be displayed to your site visitors to determine if the user is not a robot. Using Custom Pages, you can customize these pages.

To design DDoS pages, you must set the %Challenge% variable in the file you upload for the dedicated page.

JS Challenge

By default, for a JS challenge, a page like the one below is displayed to visitors:

Setting up a custom JavaScript challenge page via the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/arian.run/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: API KEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'file=@"/path/to/file"' \

--form 'page="ddos_js"' \

--form 'type="file"'

Captacha Challenge

By default, for the Captcha challenge, a page like the one below is displayed to visitors:

Setting up a custom Captcha challenge page via API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/arian.run/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: API KEY 1 2 3 4' \

--form 'file=@"/path/to/file"' \

--form 'page="ddos_captcha"' \

--form 'type="file"'

After activating the secure link on the content, only users who use their encrypted and specially generated link can access the requested path. These restrictions can be applied based on the specific IP address and duration of access.

If the user's identity is not confirmed based on the requested parameters, the following error will be displayed by default:

Set "Redirect " for Secure Link error using API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'page="secure_link_invalid"' \

--form 'url="https://example.com/securelink"' \

--form 'type="url"'

"Upload HTML" for Secure Link error using the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'file=@"/C:/Users/arvan/Desktop/example.html"' \

--form 'page="secure_link_invalid"' \

--form 'type="file"'

Firewall Errors

Arvancloud Firewall allows you to define security rules in a cloud environment and manage access to your content with the highest level of security by applying various restrictions. You can specify which page your visitors are shown when firewall errors occur.

By default, Arvancloud error pages for the firewall are as shown below:

Configure firewall error "Redirect" using API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'page="firewall_error"' \

--form 'url="https://example.com/firewall"' \

--form 'type="url"'

"Upload HTML" for Firewall error using the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'file=@"/C:/Users/arvan/Desktop/example.html"' \

--form 'page="firewall_error"' \

--form 'type="file"'

WAF Errors

WAF is a web application firewall (or layer seven network) designed and implemented to monitor or block manipulated data packets from web applications.

The default error of this service is as shown below:

Set "Redirect" for WAF error using API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'page="waf_protection"' \

--form 'url="https://example.com/waf"' \

--form 'type="url"'

"Upload HTML" for WAF error using the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'file=@"/C:/Users/arvan/Desktop/example.html"' \

--form 'page="waf_protection"' \

--form 'type="file"'

Rate Limit Errors

Using Rate Limiting, it is possible to control incoming/outgoing traffic to/from a network. This is done by limiting the number of requests sent by the user.

If the user exceeds the allowed amount of traffic, they will encounter an error, which by default looks like the image below:

Setting "Redirect" for Rate limit error using API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'page="rate_limit_exceeded"' \

--form 'url="https://example.com/rl"' \

--form 'type="url"'

"Upload HTML" for Rate limit error using the API:

curl --location --request GET 'https://napi.arvancloud.ir/cdn/4.0/domains/example.com/custom-pages' \

--header 'authority: napi.arvancloud.ir' \

--header 'accept: application/json, text/plain, */*' \

--header 'authorization: APIKEY 1 2 3 4' \

--header 'cache-control: no-cache' \

--form 'file=@"/C:/Users/arvan/Desktop/example.html"' \

--form 'page="rate_limit_exceeded"' \

--form 'type="file"'