Connection Process (Cloud Mode)

To let your cloud WAF instance protect your website, domain name of the website must be connected to your WAF instance so that the website incoming traffic can go to WAF first.

Constraints

  • A cloud WAF instance can protect web applications and websites that are accessible through domain names. For details, see Edition Differences
  • After your website is connected to WAF, the file visitors can upload each time cannot exceed 512 MB.

Prerequisites

The following describes how WAF works when there is a proxy used or no proxy used in front of WAF:

  • Proxy used

    If your website has used proxies, such as anti-DDoS, Content Delivery Network (CDN), or cloud acceleration, Figure 1 shows how WAF works.

    • DNS resolves the domain name to the proxy IP address before your website is connected to WAF. In this case, the traffic passes through the proxy and then the proxy routes the traffic back to the origin server.
    • After your website is connected to WAF, DNS resolves your domain name to the access address of WAF. In this way, the proxy forwards the traffic to WAF. WAF then filters out illegitimate traffic and only routes legitimate traffic back to the origin server.
      1. Change the back-to-source IP address of the proxy to the CNAME record of WAF.
      2. (Optional) Add a WAF subdomain name and TXT record at your DNS provider.
    Figure 1 WAF configuration when a proxy is used
  • No proxy used

    If no proxy is used before the website is connected to WAF, Figure 2 shows how WAF works.

    • DNS resolves your domain name to the origin server IP address before your website is connected to WAF. Therefore, web visitors can directly access the server.
    • After your website is connected to WAF, DNS resolves your domain name to the CNAME record of WAF. In this way, the traffic passes through WAF. WAF then filters out illegitimate traffic and only routes legitimate traffic back to the origin server.
    Figure 2 No proxy used

Processes of Connecting a Website to WAF

After purchasing a cloud WAF instance, complete the required configurations by following the process shown in Figure 3.

Figure 3 Process of connecting a website to WAF - Cloud Mode
Table 1 Process of connecting your website domain name to WAF

Procedure

Description

Step 1: Adding a Domain Name to WAF (Cloud Mode)

Configure basic information, such as the domain name, protocol, and origin server.

Step 2: Testing WAF

To ensure that your WAF instance forwards website traffic normally, test the WAF instance locally and then route traffic destined for the website domain name to WAF by modifying DNS record.

Step 3: Routing Website Traffic to WAF

  • No proxy used

    Configure a CNAME record for the protected domain name on the DNS platform you use.

  • Proxy (such as advanced anti-DDoS and CDN) used

    Change the back-to-source IP address of the used proxy, such as advanced anti-DDoS and CDN, to the copied CNAME record.

Step 4: Whitelisting WAF Back-to-Source IP Addresses

If other security software or firewalls are installed on your origin server, whitelist only requests from WAF. This ensures normal access and protects the origin server from hacking.

After you connect a domain name to WAF, WAF works as a reverse proxy between the client and the server. The real IP address of the origin server is hidden and only the IP address of WAF is visible to web visitors.

Fixing Inaccessible Websites

If a domain name fails to be connected to WAF, its access status is Inaccessible. To fix this issue, see Why Is the Access Status of a Domain Name or IP Address Inaccessible?