Example Configuration
When adding a domain name to WAF, the configurations are slightly different based on the service scenarios.
- Example 1: Configuring Service Protection for Port 80/443
- Example 2: Forwarding Client Requests to Different Origin Servers
- Example 3: Protection for One Domain Name with Different Protected Ports
- Example 4: Configuring Protocols for Different Access Methods
Example 1: Configuring Service Protection for Port 80/443
Configuration scenario: Protection for web services over port 80 or 443
- Protected Port: Select Standard port.
- Client Protocol
- Protection for port 80: Select HTTP.
- Protection for port 443: Select HTTPS.
- Protection for both ports 80 and 443: Configure two pieces of server information and set Client Protocol to HTTP and HTTPS, respectively, as shown in Figure 1.
- In Figure 1, the parameter settings in the red box are fixed. Set other parameters based on site requirements.
- In this case, your website visitors can access the website without adding a port to the end of the domain name. For example, they can enter http://www.example.com in the address box of the browser to access the website.
Example 2: Forwarding Client Requests to Different Origin Servers
Configuration scenario: Using WAF to distribute client requests for the same protected object across different origin servers.
For example, you want to add domain name www.example.com and port 8080 to WAF, and want to let WAF forward client requests to two backend servers.
- Domain Name: www.example.com
- Protected Port: 8080
- Client Protocol: SecMaster auto-fills the client protocol based on the protected port you select. Only HTTP supports port 8080. So, Client Protocol must be to HTTP for the two pieces of origin server information.
- In Figure 2, the parameter settings in the red box are fixed. Set other parameters based on site requirements.
- In this scenario, visitors need to add a port number to the end of the domain name when they try to access the website. Otherwise, error 404 will be reported. For example, they need to enter http://www.example.com:8080 in the address box of the browser to access the website.
Example 3: Protection for One Domain Name with Different Protected Ports
Each combination of a domain name and a non-standard port is counted towards the domain name quota of the WAF edition you are using. For example, www.example.com:8080 and www.example.com:8081 use two domain names of the quota. If you want to protect web services over multiple ports with the same domain name, add the domain name and each port to WAF.
Example 4: Configuring Protocols for Different Access Methods
WAF provides flexible combinations of protocol configurations. If your website is www.example.com, WAF provides the following four access modes:
- In HTTP forwarding mode, set both Client Protocol and Server Protocol to HTTP, as shown in Figure 3.
In this scenario, the client accesses the website over HTTP, and WAF forwards requests to the origin server over HTTP. So, this mode is suitable when encrypted transmission is not required.
- In Figure 3, the parameter settings in the red box are fixed. Set other parameters based on site requirements.
- This configuration allows web visitors to access the website over HTTP only. If they access it over HTTPS, they will receive the 302 Found code and be redirected to http://www.example.com.
- In HTTPS forwarding, HTTPS is set to Client Protocol and Server Protocol, as shown in Figure 4. This configuration allows web visitors to access your website over HTTPS only. If they access over HTTP, they are redirected to https://www.example.com.
In this scenario, the client accesses the website over HTTPS, and WAF forwards requests to the origin server over HTTPS as well. So, this mode is suitable when encrypted transmission is required.
- In Figure 4, the parameter settings in the red box are fixed. Set other parameters based on site requirements.
- If visitors access your website over HTTPS, the website returns a successful response.
- If visitors access your website over HTTP, they will receive the 301 Found code and are directed to https://www.example.com.
- In HTTP and HTTPS forwarding, configure two pieces of server configurations, one with Client Protocol and Server Protocol set to HTTP, and the other with Client Protocol and Server Protocol set to HTTPS, as shown in Figure 5.
This configuration applies only to protection for standard ports 80 and 443.
- In Figure 5, the parameter settings in the red box are fixed. Set other parameters based on site requirements.
- If visitors access your website over HTTP, the website returns a successful response. Communications between the browser and website are not encrypted.
- If visitors access your website over HTTPS, the website returns a successful response and all communications between the browser and website are encrypted.
- If you want to use WAF for HTTPS offloading, select HTTPS for Client Protocol and HTTP for Server Protocol, as shown in Figure 6.
In this scenario, when a client accesses a website, HTTPS is used for encrypted transmission, and WAF uses HTTP to forward requests to the origin server.
- In Figure 6, the parameter settings in the red box are fixed. Set other parameters based on site requirements.
- If visitors access your website over HTTPS, WAF forwards the requests to your origin server over HTTP.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.