What should I do if I failed to set a custom domain name in the COS console?
- Make sure that the domain name has obtained an ICP filing.
- Make sure that the DNS resolution of the domain name is correct. If CDN acceleration is disabled, you need to go to the DNS console to map the CNAME record of your domain name to the default domain name of the bucket.
What is the difference between enabling and disabling CDN acceleration if I have my own domain name bound?
- CDN acceleration enabled: The domain name is managed by CDN. Enabling CDN acceleration in the COS console has the same effect as adding a domain name in the CDN console (setting COS as the origin). The CDN-allocated CNAME record is needed for DNS resolution. During the configuration, add the domain name first and then resolve it.
- CDN acceleration disabled: The domain name is managed by COS. The domain name configuration is delivered to all download devices connected to the region where the bucket resides. The default domain name of the bucket is used as the CNAME record for DNS resolution.
Other custom headers can take effect once set. However, Content-Disposition
takes effect only if the static website hosting feature is enabled and you access objects with a custom domain name.
What should I do if a static website cannot be accessed by using a CDN domain name?
Check the configuration of the CDN-accelerated domain name in the following steps:
- Select Static Website Endpoint as the origin type.
- Set origin-pull authentication and CDN service authorization based on the bucket permission:
- If the bucket permission is private read, authorize the CDN service and enable origin-pull authentication.
- If the bucket permission is public read, there is no need to authorize the CDN service or enable origin-pull authentication.
Set CDN authentication based on the bucket permission:
(1) If the bucket permission is private read:
CDN Authentication | Access at CDN Acceleration Domain Name | Access at COS Domain Name | Use Case |
Disabled (default) | No | COS authentication required | Direct access to the CDN domain name to protect the content on the origin |
Enabled | URL authentication required | COS authentication required | Full-linkage protection (with hotlink protection for CDN authentication supported) |
(2) If the bucket permission is public read:
CDN Authentication | Access at CDN Acceleration Domain Name | Access at COS Domain Name | Use Case |
Disabled (default) | Yes | Yes | Site-wide public access via CDN or origin |
Enabled | URL authentication required | Yes | Hotlink protection enabled for access via CDN but not origin (not recommended) |
After confirming that the above configurations are correct, check the protocol used to access the CDN acceleration domain name and the forced HTTPS configuration of the static website:
- If you are using the HTTP protocol to access the CDN acceleration domain name, do not enable forced HTTPS.
- If you are using the HTTPS protocol to access the CDN acceleration domain name, we recommend you enable follow 301/302 for the CDN acceleration domain name. For more information, see Follow 301/302 Configuration.
- If the problem persists, contact us for assistance.
What should I do if 404 is returned on refresh when the static website is used together with the frontend Vue framework and the router is set to History mode?
On the static website configuration page of the bucket, set the error document path to the landing page of the web application (generally index.html) and set the status code of the error document to 200. For the configuration directions of static websites, see Setting Up a Static Website.
Note:
After the above configurations are completed, if you need 404 to respond normally, you can configure it at the most bottom layer of the Vue frontend router configuration. In most cases, wildcards match the custom 404 component.
Apakah halaman ini membantu?