Help Center/ Cloud Application Engine/ Best Practices/ Guide to Configure CAE Access Modes/ Scenario 1: Accessing CAE Components from the Public Network
Updated on 2025-11-03 GMT+08:00

Scenario 1: Accessing CAE Components from the Public Network

Scenario

If CAE components need to be accessed by objects outside the environment (such as external users, third-party systems, or O&M tools), the public network access capability needs to be enabled.

You can configure the port for accessing components from another environment on CAE. After the configuration, you can access the CAE components from the public network.

This section describes how to access CAE components from the public network.

Restrictions

This function is available only in CN North-Beijing4, CN South-Guangzhou, CN East-Shanghai1, ME-Riyadh, TR-Istanbul, AF-Johannesburg, LA-Mexico City2, and LA-Sao Paulo1.

Prerequisites

Step 1: Configure an Access Domain Name

  1. Log in to CAE.
  2. Choose System Settings.
  3. Click Edit under System Networks.
  4. Click the Inbound Configuration tab.
  5. Click Add Domain Name Suffix and set the domain name and certificate by referring to Table 1.

  6. Click Save.

Step 2: Configure the Port for Accessing the Component from Another Environment

  1. On the CAE console, choose Component Configurations in the navigation pane.
  2. Select the target component cae-test from the drop-down list in the upper part of the page.
  3. Click Edit in the Access Mode module.
  4. In Access Component from Another Environment, set Access Domain Name by referring to Table 3.

    Table 3 Component domain name configuration

    Parameter

    Description

    Example Value

    Access outside the environment

    1. Select an environment level from the drop-down list.

      Option source: domain name set when you configure the network access information.

      Example: *.component.example.com

    2. Enter the component domain name for external access.

      Example: compA-dev

    1. Select the domain name *.abc.com configured in step 1.
    2. Enter cae-test.

    Access in the Environment

    The domain name for accessing components in the environment cannot be changed.

    Default domain name: {Component ID}.{Application ID}.internal.{Environment ID}.{Region ID}.cae.com

    Example: compA.appA.internal.16dd810*******496d.cn-north-7.cae.com

    Retain the default value for this parameter.

  5. Click Add Forwarding Policy and configure a forwarding policy.

    Table 4 Forwarding policy configuration (HTTP)

    Parameter

    Description

    Example Value

    Match URL By

    You can select Prefix, Regular expression, or Exact.

    • Prefix: URLs whose prefix is the same as the specified one can be accessed, for example, /healthz/v1 and /healthz/v2.
    • Regular expression: The URL rule can be set, for example, /[A-Za-z0-9_.-]+/test. All URLs that comply with this rule can be accessed, for example, /abcA9/test and /v1-Ab/test. Two regular expression standards are supported: POSIX and Perl.
    • Exact: Only the URL that is the same as the specified one can be accessed. For example, if the URL is set to /healthz, only /healthz can be accessed.

    Prefix

    URL

    A URL is in the format of Protocol://IP address:Port/Path?Parameter.

    After a URL is configured, the forwarding policy can accurately forward requests to the corresponding service API based on the path (for example, /a/b or /c/d).

    Naming rule: Enter up to 128 characters. Start with a slash (/) and only use letters, digits, and special characters _~';@^-%#&$.*+?,=!:|/()[]{}. Example: /healthz.

    If only / is entered, requests of the root path and all sub-paths under the root path are matched.

    /

    Component

    Name of the component for which you want to configure the access mode.

    cae-test

    Listening Port

    Receives access requests from external systems (such as ECSs in a VPC and other CAE components). The value must be the same as the port provided by the CAE component for providing services (when no port mapping is available) to ensure that requests can be accurately routed to the service entry of the target component.

    Value range: 1 to 65535.

    8080

  6. Click OK.
  7. Make the configurations take effect.

    • If the component has been deployed, click Activate Settings in the upper part of the page. In the dialog box displayed on the right, confirm the configurations and click OK for the configurations to take effect.
    • If the component has not been deployed, click Set and Deploy Component in the upper part of the page. In the dialog box displayed on the right, click OK. After the deployment is complete, the configurations take effect.

  8. After the configurations take effect, the public network address access domain name cae-test.abc.com is displayed in the access mode module.

(Optional) Step 3: Configure the hosts File on the Local Device to Map the Domain Name to a Specified IP Address

If the access domain name configured in step 1 is not registered and DNS resolution is not configured through a public domain name service provider (that is, the domain name cannot be used to query the corresponding IP address on the public DNS server), you need to configure the hosts file on the local device (such as a PC or ECS in a VPC) that needs to access the CAE component and add the mapping between the domain name and the public or private IP address of the CAE component so that the local device can access the CAE component using the domain name.

If the access domain name configured in step 1 has been registered and DNS resolution has been configured through a public domain name service provider, skip this step.

  1. Obtaining the public IP address of the load balancer selected during environment creation

    1. Choose Overview.
    2. At the bottom of the overview page, click the name of the load balancer to go to the ELB console.
    3. Click the Summary tab.
    4. Find and copy the value of IPv4 EIP of the load balancer. Example Value: 198.51.100.xx

  2. Obtaining the public IP address access domain name configured in step 2

    1. Choose Component Configurations.
    2. On the displayed page, find and copy the public IP address access domain name cae-test.abc.com from Access Mode.

  3. Configuring the hosts file to resolve a specific domain name to a specified IP address

    1. Open the hosts file on the local device.
    2. Configure the hosts file based on the following rules:
      [Destination IP address] [Domain name] #Optional annotation (describes the purpose of the mapping.)
      Enter the following information in a new line:
      198.51.100.xx cae-test.abc.com # Local mapping: domain name for accessing the public IP address corresponding to the public IP address of the CAE component
    3. Save the hosts file.

Step 4: Access the CAE Component from the Public Network

  1. Choose Component Configurations.
  2. On the displayed page, find and copy the public IP address access domain name cae-test.abc.com from Access Mode.
  3. Open the local browser and enter the copied public IP address in the address box.

    There are two scenarios for accessing the public network address: HTTP and HTTPS.
    1. HTTP scenario: http://cae-test.abc.com
    2. HTTPS scenario: https://cae-test.abc.com

  4. Press Enter to access the target CAE component.