Help Center> Content Delivery Network> FAQs> Troubleshooting> Why Are All Files in the Bucket Displayed When Users Request a File from an OBS Bucket Connected to CDN?

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 file list of the bucket. When the user requests the domain name added to CDN, OBS returns the file list by default. The solution is as follows:

  1. If you use an OBS public bucket, perform the following steps to rectify the fault:
    1. Enable static website hosting on OBS. For details, see Configuring Static Website Hosting.
    2. Select Static website hosting on the origin server settings page.
      1. Click the target domain name on the Domains page.
      2. On the Basic Settings tab page, click Edit next to Origin Server Settings.
      3. Select Static website hosting and click OK.

        When Static website hosting is enabled, the bucket list may still be displayed due to cache of points of presence (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.
  2. If you use an OBS private bucket, follow step 6 in Using CDN to Accelerate OBS File Download.