tencent cloud

Integration with Cloud Functions
Last updated: 2025-07-07 17:39:10
Integration with Cloud Functions
Last updated: 2025-07-07 17:39:10

Step 1: Verify Cloud Function Configuration

If your web service has enabled Tencent Cloud Serverless Cloud Function (SCF), you can configure domain protection in the Cloud Function WAF instance. Please log in to the Serverless Console, and in the left navigation bar, select Function Service to verify whether Cloud Function is in use.
Note:
Different WAF versions support different numbers of domains. For details, please refer to the WAF plan and version description.

Step 2: Add Domain and Bind to Cloud Function

1. Log in to the WAF console and select Connection Mangement > Domain Onboarding on the left sidebar.
2. On the domain onboarding page, click Add domain, configure relevant parameters, and click OK.

Field description
Associated instance: Select the CLB type and an instance name.
Domain name: Enter the domain name to be protected, such as test.com.
Traffic source: Select Cloud Function.
Use proxy: Select whether proxy services including Anti-DDoS and CDN are used based on the actual conditions.
Note:
If you select Yes, WAF will get real client IPs, which may be forged, from the XFF field as the source IPs.
Outside China: Select based on the location of the cloud function service.
Remarks: Enter your remark.
3. Click OK to verify that the protected domain has been successfully added.
4. After completing, return to the SCF console, go to the Custom Domain page, and select Enable WAF. Then, select the corresponding instance ID from the WAF instance dropdown list, see Cloud Function product documentation.

Step 3: Verification Test

In the browser, enter the URL http://<Gateway Domain or IP>/?test=alert(123)and access it. If the browser returns a blocked page, it indicates that the Web Application Firewall protection function is working properly.





Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback