Why Are All Files in the Bucket Displayed When Users Request a File from an OBS Bucket Connected to CDN?
A user that has the read permission on an OBS bucket can read the object list of the bucket. When the user requests the domain name added to CDN, OBS returns the object list by default. You can use any of the following solutions:
- If you use an OBS public bucket, perform the following steps to rectify the fault:
- Enable static website hosting on OBS. For details, see Configuring Static Website Hosting.
- Select Static website hosting on the origin server settings page.
- Click the target domain name on the Domains page.
- On the Basic Settings tab, locate the corresponding OBS bucket origin server in the Origin Server Settings area.
- Click Edit in the Operation column of the origin server and select Static website hosting.
- Click OK.
When Static website hosting is enabled, the object list of the bucket may still be displayed due to cache on PoPs. In this case, purge the cache of the homepage URL.
- (Recommended) Set Type to URL when purging the cache of homepage URL.
- Setting Type to Directory will refresh all content in the directory, so CDN will need to pull content from the origin server, increasing the load on the origin server.
- If you use an OBS private bucket, create a policy for the CDNAccessPrivateOBS agency to deny listing objects in the bucket.
- In the navigation pane of the IAM console, choose Operation column of CDNAccessPrivateOBS, click Authorize. . In the
- On the Authorize Agency page, click Create Policy and set required parameters.
Table 1 Parameters Parameter
Description
Policy Name
Enter a policy name, for example, deny ListBucket.
Policy View
Select Visual editor.
Policy Content
Effect
Select Deny.
Cloud service
Select Object Storage Service (OBS).
Actions
Select obs:bucket:ListBucket.
Resources
Select All.
Request condition
-
- Click Next.
- On the Select Policy/Role page, select the created policy and click Next.
- On the Select Scope page, click OK. The authorization takes effect 15 to 20 minutes later.
- After the authorization takes effect, refresh the CDN cache and try again.
Troubleshooting FAQs
- Why Am I Seeing a Message Indicating that the Domain Name Already Exists When I Add a Domain Name for CDN Acceleration?
- Why Is My Domain Name Inaccessible After HTTPS Secure Acceleration Is Configured?
- Why Am I Seeing a Message Indicating Insufficient Permission When I Call a CDN API as an IAM User?
- Why Is Data Obtained from a CDN PoP Not the Updated Data?
- What Do I Do If the Browser Displays a Message Indicating that a Cross-domain Exception Occurs After CDN Is Enabled?
- Why Is 304 Returned When a User Accesses a Resource Under My Acceleration Domain Name?
- Why Does Agency Creation for OBS Fail When an OBS Private Bucket Is Used as the Origin Server?
- Why Is the Accelerated Page Incorrect Even Though I Can Access the Origin Server?
- Why Can't a Web Page Be Properly Displayed After the Origin Server's IP Address Is Changed?
- Why Do I Get an Access Failure and Access-Control-Allow-Origin Error?
- Why Does Baidu Spider Fail to Capture Data?
- Why Are All Files in the Bucket Displayed When Users Request a File from an OBS Bucket Connected to CDN?
- Why Does the Video Freeze After CDN Is Configured?
- Why Is My CDN Disabled?
- Why Does the System Always Display "301" After HTTPS Is Configured for a Domain Name?
- Why Do I Get Request Timed Out When Trying to Ping an Acceleration Domain Name?
- Why Are Incorrect Resources Being Pulled from My Origin Server?
- Why Is My Site Slow the First Time I Access It After CDN Is Configured?
- Why Is My Acceleration Domain Name Inaccessible Outside the Chinese Mainland?
- Why Is a File in an OBS Bucket with CDN Acceleration Enabled Be Automatically Downloaded When I Access the File?
- How Do I Do If a Domain Name Fails to Be Added?
- Why Is the Button for Adding a Domain Name Unavailable on the CDN Console?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore