Package a static website
Host a static website in the Web+ console
- Log on to the Web App Service console and select the required region in the upper-left corner of the page.
- On the Overview page, click Create in the upper-right corner of the Last Updated Deployment Environments section.
- In the Basic Information step, select Native for Tech Stack Type, configure basic information about the application, and then click Next.
Parameter Description Tech Stack Type The type of the technology stack. Select a technology stack based on your business needs. In this example, select Native. Application Name The name of the application. Application Description The description of the application. This parameter is optional. Use Free Storage Space If you enable the Use Free Storage Space feature, uploaded deployment packages, collected logs, and diagnostic information in the lifecycle of the application are all stored in the free storage space. This minimizes storage costs. If you require a high level of data privacy, you can disable this feature. After this feature is disabled, all data is stored in your Object Storage Service (OSS) bucket.
- In the Environment Information step, set a name for the deployment environment and upload the deployment package.
Then click Next.
Parameter Description Tech Stack Version The version of the technology stack. Select a version from the drop-down list. Environment Name The name of the deployment environment. Environment Description The description of the deployment environment. This parameter is optional. Package Source The source of the deployment package. You can select Upload Local Application or Use Sample Application. In this example, select Upload Local Application, click Select File, and then select the deployment package to be uploaded. Package Version The version of the deployment package. Web+ provides a default deployment package version. You can change the default deployment package version. Version Description The description of the deployment package version. This parameter is optional.
- In the Configurations step, select Custom in the Preset Configuration field.
- In the architecture diagram of the Environment section, click Reverse Proxy and configure a reverse proxy.
- On the Reverse Proxy page, select Use Custom Configuration.
- Copy the following content to the Custom NGINX Configuration field:Note
- The root command of the server parameter under http must point to the deployment directory of the static website. This directory is typically stored in /home/admin/app. The directory name website is the same as the name of the deployment package. Modify the directory information based on your business needs.
- You can modify the NGINX configuration file based on your business needs.
- In the lower-left corner of the Configurations step, click Create with Custom Configuration. In the Actions dialog box, confirm the change list and click Start WordPress.
- In the Finish step, click View environment Logs.
- In the Change Events dialog box, check the changes that are being made. After the changes are complete, close the Change Events dialog box.
- On the Environment Details page, click the URL on the right side of Public Address to access the static website.