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.
- Log in to OBS Console. In the navigation pane, choose .
- Click the name of the bucket to configure static website hosting.
- In the navigation pane, choose .
- Click Configure Static Website Hosting and enable Status. For details about how to set related parameters, see Configuring Static Website Hosting.
- Go to the CDN console. When adding a domain name or modifying the origin server settings of a domain name, select Static website hosting.
- Click OK. -website is added to the origin server address.
Figure 1 Origin server details
- 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.
- Go to the CDN console and choose from the navigation pane.
- In the domain list, click the target domain name or click Configure in the Operation column.
- Click the Cache Settings tab.
-
In the Cache Rules area, click Edit.
The Configure Cache Rule dialog box is displayed.
- Configure a cache rule whose Type is Homepage, TTL is 0, and priority is higher than that of other rules.
- 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.
- Click OK.
- 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.
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.
Chatbot