This topic describes how to use Anti-DDoS Origin and Web Application Firewall (WAF) to provide protection. This solution protects your website against Layer 4 distributed denial of service (DDoS) attacks, Layer 7 web attacks, and HTTP flood attacks.
- An Elastic Compute Service (ECS) instance is created and has web applications installed.
The ECS instance has a public IP address, and your website has a domain name.
Note If your website provides services in mainland China, the domain name of your website must have an Internet Content Provider (ICP) license. Otherwise, you cannot add the domain name to WAF instances in mainland China to protect your website.
- An Anti-DDoS Origin Enterprise instance is purchased. For more information, see Purchase an Anti-DDoS Origin Enterprise instance.
Note When you purchase an Anti-DDoS Origin Enterprise instance, you must select a region. Make sure that the Anti-DDoS Origin Enterprise instance and the ECS instance reside in the same region.
- A WAF instance is purchased. For more information, see Purchase a WAF instance.
If you use Anti-DDoS Origin Enterprise and WAF to protect your website, you must add your website to WAF and then add the IP address of the WAF instance to Anti-DDoS Origin Enterprise for protection. In this case, all service traffic is first scrubbed by WAF, and only normal traffic is forwarded to the origin server. Attack traffic, such as DDoS attacks, web attacks, and HTTP flood attacks, is blocked.
- Add your website to WAF.
- Log on to the WAF console.
- In the top navigation bar, select the Mainland China or International region.WAF automatically determines the specific region based on the location of the origin server.
- In the left-side navigation pane, choose .
- Click Add Domain Name.You can add your website in two modes: CNAME and transparent proxy. In CNAME mode, the website can be automatically or manually added. In transparent proxy mode, only origin servers that are deployed in the China (Beijing) region are supported.xxxx
This topic describes how to add a website in CNAME mode.
- Optional:On the Add Domain Name page, click Manually Add Other Websites. If the Add Domain Name page does not appear, skip this step.
- Complete the configurations in the Enter your website information step of the Add Domain Name wizard and click Next.You must specify the following website parameters:
- Domain Name: Enter the domain name of the website.
- Protocol Type: Select the protocol supported by the website. If your website supports HTTPS, select HTTPS and upload the certificate after you add the website. For more information, see Upload HTTPS certificates.
- Destination Server (IP Address): Select IP and enter the public IP address of the ECS instance.
- Destination Server Port: After you specify Protocol Type, the server port is automatically matched. You can also specify a non-standard server port. For more information, see Supported custom ports.
- Does a layer 7 proxy (DDoS Protection/CDN, etc.) exist in front of WAF: Select No.
If you configure a Layer 7 proxy such as Anti-DDoS Pro, Anti-DDoS Premium, or Content Delivery Network (CDN) before WAF, the requests from a client are forwarded to the Layer 7 proxy before they reach WAF. Anti-DDoS Origin Enterprise is not a Layer 7 proxy. In this case, select No.
For more information about the website parameters, see Add domain names.
- Click Completed. Return to the website list.A CNAME record is created for the added website. You can obtain the CNAME record of WAF from the website list.
- Run the
ping the CNAME record of WAFcommand on your computer to obtain the IP address of the WAF instance.
- Configure your origin server to allow the back-to-origin Classless Inter-Domain Routing
(CIDR) blocks of WAF.For more information, see Allow access from WAF back-to-origin CIDR blocks.
- Change the DNS settings to resolve the domain name of the website to the CNAME record
of WAF that you obtain in Step 1.For more information, see Change the DNS settings.After you change the DNS settings, all requests sent to your website are forwarded to WAF for traffic scrubbing. WAF blocks web attacks and HTTP flood attacks and only forwards normal traffic to the origin server.
The WAF instance cannot mitigate volumetric DDoS attacks. If your service encounters volumetric DDoS attacks, the performance of the WAF instance deteriorates, which affects service forwarding. Therefore, you must use an Anti-DDoS Origin Enterprise with the WAF instance to protect your service from DDoS attacks.
- Add the IP address of the WAF instance to your Anti-DDoS Origin Enterprise instance
for protection.For more information, see Add a cloud service to Anti-DDoS Origin Enterprise for protection.After you add the IP address of the WAF instance, the Anti-DDoS Origin Enterprise instance provides unlimited protection. The Anti-DDoS Origin Enterprise instance automatically scrubs service traffic to mitigate DDoS attacks.