Help Center/ Content Delivery Network/ Best Practices/ Customizing a Homepage When the Origin Server Is an OBS Bucket
Updated on 2025-05-19 GMT+08:00

Customizing a Homepage When the Origin Server Is an OBS Bucket

Scenario

If the origin server of CDN is an OBS bucket, the object list is displayed when a user accesses the acceleration domain name. To hide the object list from users, you can customize a homepage.

Procedure

  • If the origin server is an OBS public bucket, enable static website hosting on OBS and select Static website hosting on CDN.
    1. Log in to OBS Console. In the navigation pane, choose Buckets.
    2. Click the name of the bucket to configure static website hosting.
    3. In the navigation pane, choose Basic Configurations > Static Website Hosting.
    4. Click Configure Static Website Hosting and enable Status. For details about how to set related parameters, see Configuring Static Website Hosting.
    5. Go to the CDN console. When adding a domain name or modifying the origin server settings of a domain name, select Static website hosting.
    6. Click OK. -website is added to the origin server address.
      Figure 1 Origin server details
    7. Refresh the homepage of the domain name and access the domain name again. The default homepage of the domain name with static website hosting is displayed.
  • If the origin server is an OBS private bucket, configure homepage origin pull.
    1. Go to the CDN console and choose Domains from the navigation pane.
    2. In the domain list, click the target domain name or click Configure in the Operation column.
    3. Click the Cache Settings tab.
    4. In the Cache Rules area, click Edit.

      The Configure Cache Rule dialog box is displayed.

    5. Configure a cache rule whose Type is Homepage, TTL is 0, and priority is higher than that of other rules.
    6. Click the Origin Settings tab and click Edit next to Origin URL Rewrite.
      • Match Mode: Wildcard
      • Original URI: /
      • Target URI: Enter the path of the homepage that you want users to view.
      • Priority: Set the highest priority.
    7. Click OK.
    8. After the configuration takes effect (about 5 to 10 minutes), refresh the homepage of the domain name. The rewritten page is displayed when you access the domain name.