How to deal with it when some files are not displayed or 403 appears on the website after use of CDN
In order to avoid the problem of an incomplete cached file, Baidu AI Cloud CDN uses Content-Length on the node of CDN to check whether the file length is correct. A file needing an origin server carries Content-Length or transfer-encoding parameter.
For error 403, you can check the following clips:
- Verify whether the origin sever is normal and returns 403.
- Check whether configurations of the hotlink protection, refer, IP blacklist and whitelist and waf are normal.
- 3.Illegal content (pornographic content, etc.) will also leads 403.
If the problem is not solved, you are recommended to submit [Storage and CDN/Content Delivery Network CDN] ticket to describe your problem in details, and provide: Our engineers troubleshoot and solve problems for you, such as accelerated domain names, screenshots of local ping accelerated domain names, recurrence steps or exceptional URLs.
CDN 404 error is generally caused by the following reasons:
- Origin server 404 results in 404 of CDN, recommend testing the domain name after direct resolution of origin server.
- You are recommended to refresh CDN cache in the console as a result of visiting old cached pages. Clear local browser cache and test again.
- It may be led by CDN node problems, you are suggested to ping accelerated domain name and submit the result screenshots to the ticket, and our engineers will investigate and solve the problems.
Low CDN hit ratio is generally caused by the accessed CDN, for there are few cache files, or less cacheable contents and low website visits are caused by the origin server type, there is a short expiration time, few hit files, the console is not set with file cache or no cache can be realized due to Httpheader. You can check your website visits and the set of file cache rules.
At present, CDN log management relies on the BOS service. You can download CDN logs directly after enabling the BOS service (Note: No BOS charges will generate as long as you do not store data in your account BOS).
You can re-add the CDN domain name deleted, and then download the corresponding log from the log management of console.
The log cannot be queried until CDN domain name is added again. It is unable to query the log without CDN domain name after deletion.
For the 502 error problem, you can check the following parts:
- Origin server 502 causes an error 502 of CDN, and you can check the origin server.
- Certificate chain exception causes 502.
- The resource acquisition of origin server is over 60 S.
If the problem is not solved, you are recommended to submit [Storage and CDN/Content Delivery Network CDN] ticket to describe your problem in details, and provide: Repetition steps or abnormal URL of accelerated domain name and local ping accelerated domain name screenshots and attachments We will assign engineer to check and solve the problem for you.