Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Procedure

Updated on 2025-01-17 GMT+08:00

Restrictions

The official Nginx image is executed by the Nginx user. You need to set the file mask (umask) of the mounted file to 0022 to ensure that the Nginx user has the permission to read the mounted file. For details, see Configuring a Cloud Storage Mount Path.

Creating and Deploying a Nginx Component

  1. Log in to CAE.
  2. Choose Components.
  3. Select the created application and environment from the drop-down lists in the upper part of the page, and click Create Component.
  4. Configure the component by referring to Table 1.

    Table 1 Basic component information

    Parameter

    Description

    Component

    Enter a component name. In this practice, enter nginx.

    Version

    Enter a component version.

    In this practice, enter 1.0.0.

    Specifications

    Select instance specifications, for example, 0.5 Core and 1 GiB.

    Instances

    Set it to 1.

    Code Source

    Choose Images > Open Source Images > nginx. In this practice, select Nginx alpine-perl.

    Figure 1 Creating a component

  5. Click Configure Component.
  6. On the Component Configurations page, click Edit in the Access Mode module to configure the Nginx component.
  7. On the Load Balancing tab, click Add Load Balancer and set parameters.

    • Load Balancer: Select Built-in load balancer.
    • Health Check: Use the default value Start.
    • Access Control: Select Allow all IP addresses.
    • Protocol: Select TCP.
    • Listening Port: Enter 80.
    • Access Port: Enter an access port. In this practice, enter 14632.
    Figure 2 Adding external network access for load balancing

  8. Click OK.
  9. On the Component Configurations page, click Set and Deploy Component for the Nginx component access mode to take effect.
  10. After deployment, choose Components.

    Click the IP address in the Access Address column of the component to view the Nginx static web page.
    Figure 3 Accessing a static page

Cloud Storage Authorizations

  1. Choose System Settings > Cloud Storage Authorizations and click Edit. The Authorized Cloud Storage dialog box is displayed.
  2. Click Authorize Parallel File System.

    Figure 4 Authorize Parallel File System

  3. Click Create Parallel File System and enter a name, for example, test-nginx.
  4. Click OK.
  5. Select the created parallel file system. You can also enter a keyword in the search box above the list to filter data.
  6. Click Authorize.

    In the displayed Access Key Authorization dialog box, enter the AK and SK, and click Confirm.

    You can click Obtain Access Key to obtain the AK/SK. For details, see Access Keys.
    NOTE:

    If your environment was created before April 20, 2024, skip this step.

  7. If the message "Authorization successful" is displayed, you can view the authorized parallel file system on the Authorized Cloud Storage page.

Uploading a File

  1. Log in to OBS.
  2. Choose Parallel File Systems and click file system test-nginx to go to the parallel system page.

    Figure 5 Parallel file systems

  3. Choose Files and click Upload File.
  4. Drag the obtained static files index.html and test.html to the file upload area. You can also click add files to upload the files. The default storage class is Standard.

    Figure 6 Uploading a file

  5. Click Upload.

Configuring a Cloud Storage Mount Path

  1. Return to CAE and choose Component Configurations.
  2. Select the Nginx component from the drop-down list in the upper part of the page.
  3. Click Edit in the Cloud Storage module.

    Figure 7 Configuring cloud storage

  4. Click Set Parallel File System, enter the mount path, and set permissions.

    • Parallel File System: Select test-nginx authorized in Cloud Storage Authorizations.
    • File Mask (umask): Enter 0022.
    • Mount Path: path to which the data store is mounted. In this practice, use the default path /usr/share/nginx/html of nginx.
    • Required Permissions: permissions on the mount path and files in the mount path. The value can be Read/Write or Read only. In this example, select Read/Write.
    Figure 8 Configuring a cloud storage mount path
    NOTE:
    • Do not mount a static file path to a directory that contains system files, such as / and /var/run. Otherwise, the components may be abnormal.
    • The Read/Write permission indicates that the component has the read and write permissions on the mount path and all files in the path. The Read only permission indicates that the component has only the read permission.

  5. Click OK. On the Cloud Storage page, click OK again.
  6. On the Component Configurations page, click Activate Settings.

    Figure 9 Activate Settings

Viewing an Updated Page

  1. Choose Components.
  2. Click the IP address in the Access Address column of the Nginx component to access the Nginx again. The page can be updated in real time (Press F5).

    NOTE:

    The new index.html file can be customized and uploaded as required.

    Figure 10 Updated static page

    You can also access the new static page file using /test.html.

    Figure 11 Accessing the test page

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback