Tencent Cloud EdgeOne + COS Deployment Guide
On this page
This document consolidates two common deployment patterns:
- API Acceleration: The client terminates TLS at the EdgeOne edge node, and EdgeOne origin-fetches via HTTPS to a load balancer or origin server.
- Static Site: Build artifacts are uploaded to COS, and EdgeOne provides a custom domain, HTTPS, caching, and cache invalidation capabilities.
All examples use placeholders and do not include real account IDs, domains, buckets, zones, load balancers, or credentials. In production, SecretId, SecretKey, and temporary tokens should be sourced from environment variables, Key Management Services (KMS), or CI Secret Stores, and must not be written to repositories or public documentation.
1. Variables and Security Boundaries
Subsequent commands uniformly use environment variables:
Security principles:
- Management accounts are used only for creating infrastructure; deployment pipelines use independent sub-accounts or short-lived credentials.
- IAM/CAM policies are authorized based on specific buckets and necessary actions, avoiding account-level
cos:*permissions. SecretKeyor fully signed request headers must not be printed in logs, shell history, or CI outputs.- Public documentation displays only placeholders; real resource lists should be stored in private operations systems.
2. Pattern A: EdgeOne HTTPS Origin Fetch for API
The recommended order is "origin fetch first, then certificate, then DNS". This allows verification before switching production traffic, avoiding 5xx errors caused by undeployed certificates or mismatched origin Host headers.
2.1 Create Acceleration Domain
Verify the following configurations:
- The origin certificate covers
ORIGIN_DOMAIN, the certificate chain is complete, and the certificate is not expired. - The origin fetch Host matches the Layer 7 routing rules of the load balancer.
- Origin port 443 allows origin fetches from EdgeOne, and management ports are not inadvertently exposed.
- HTTP to HTTPS redirection is handled at the expected layer to avoid origin fetch redirect loops.
2.2 Deploy Edge Certificate
Poll the domain and certificate status to confirm both are ready before changing DNS:
2.3 Pre-switch Verification
First, resolve the access domain assigned by EdgeOne. Use curl --resolve to direct requests to the edge node while preserving the correct SNI and Host:
EO_CNAME=".eo.dnse1.com"
EO_IP=
Only when TLS verification returns 0, the health check returns the expected status, and there are no anomalies in origin fetch logs, should you CNAME the business domain to EdgeOne.
2.4 DNS Cutover
Lower the TTL before the cutover; restore the standard TTL after stable operation. Keep the original record value to ensure a quick rollback in case of anomalies.
3. Pattern B: COS Static Site + EdgeOne
3.1 Prepare Bucket
Static website hosting typically requires:
- Creating a bucket in the specified region.
- Uploading
index.htmland static assets. - Configuring the static website homepage and error pages.
- Deciding on public read, private origin fetch, or signed access based on business needs; do not mechanically grant write permissions to the entire bucket.
The COS static website endpoint usually looks like:
<bucket>.cos-website.<region>.myqcloud.com
3.2 Create Static Site Acceleration Domain
COS_WEBSITE_ENDPOINT=".cos-website..myqcloud.com"
When OriginType=COS, do not additionally set HostHeader; the platform handles this based on the COS origin type. Subsequently, deploy the edge certificate, pre-verify, and switch DNS following the order in Pattern A.
3.3 Upload and Cache Purging
--delete will delete extra objects in the target endpoint; use it only when the build directory and target bucket prefix have been confirmed. If the release process cannot guarantee this, use immutable filenames and upload only new resources.
4. Least Privilege
The deployment account should only be granted permissions necessary for the target bucket and cache purging. The following is a structural illustration, not a complete policy ready for direct use:
Actual action names and resource formats should be based on the current Tencent Cloud CAM documentation and API responses. Before going live, verify with an independent test account that it "can publish but cannot manage other buckets".
5. Go-Live Checklist
- EdgeOne domain status is normal.
- Edge certificate covers the business domain, with a valid certificate chain and expiration date.
- API origin fetch uses HTTPS, with correct origin certificate and Host routing.
-
curl --resolvepre-verification passed. - Original DNS values are recorded for rollback in case of failure.
- Static assets use content hashing or explicit cache versioning strategies.
- HTML cache duration is shorter than that of hashed JS/CSS/images.
- Deployment account has minimal permissions for target resources only.
- No real keys or account-level resource lists in logs, scripts, or documentation.
6. Common Issues
| Symptom | Common Cause | Troubleshooting |
|---|---|---|
teo.intl... timeout | CLI used the international site endpoint | Explicitly specify --endpoint teo.tencentcloudapi.com |
| TLS handshake failure | Edge certificate is still deploying, or SNI/domain mismatch | Check certificate status and verify with openssl s_client -servername |
| EdgeOne returns 5xx | Origin unreachable, incorrect origin fetch Host, or origin certificate failure | Check origin fetch logs and directly verify origin HTTPS |
| COS origin fetch configuration rejects HostHeader | COS origin type does not allow custom HostHeader | Remove this configuration and let the platform handle it automatically |
Upload returns 403 AccessDenied | Sub-account lacks actions or resource scope for the target bucket | Check CAM policy actions and resources |
| Old page still visible after release | HTML cache not refreshed or cache key not as expected | Query cache status and purge by domain/URL |
| Some regions still access the old origin after DNS cutover | TTL not expired or recursive resolver cache | Query using multiple public DNS servers and wait for propagation |
7. Rollback
In case of certificate, origin fetch, or cache anomalies:
- Restore DNS to the pre-cutover record.
- Verify that the origin is directly accessible.
- Keep EdgeOne configurations for offline troubleshooting; do not continuously stack changes during an incident.
- After fixing the issue, pre-verify again with
curl --resolvebefore proceeding with the next cutover.
Separating certificate deployment, pre-verification, DNS cutover, and rollback is far more reliable than "changing DNS immediately after creating the domain".