Updated on 2025-10-22 GMT+08:00

Configuring the Port for Accessing the Component from Another Environment

Scenarios

If a component needs to be accessed by users, systems, or tools outside the environment (regardless of cross-network calling in a VPC or public network access), you need to configure a port to enable the access.

This section describes how to configure the port for accessing the component from another environment. After the configuration, access the component from your VPC or Internet.

What Is an Access Address?

The access address consists of a domain name and access port. For example, if the domain name is test-test-16.com and the access port is 13456, the access address is http://test-test-16.com:13456/.

Constraints

  • 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.
  • Up to 10 load balancers can be configured for a component at the same time.

Prerequisites

Adding a Port Configuration

  1. Log in to CAE.
  2. Choose Component Configurations.
  3. Select the target component from the drop-down list in the upper part of the page.
  4. Click Edit in the Access Mode module.
  5. In Access Component from Another Environment, set Access Domain Name.

    Table 1 Component domain name configuration

    Parameter

    Description

    Access from Another Environment

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

      Option source: domain name set when you configure the network access information in Configuring VPC to Access the CAE Environment in CAE.

      Example: *.component.example.com

    2. Enter the component domain name for external access.

      Example: compA-dev

    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

  6. Set the forwarding policy by referring to Table 2. To add multiple forwarding policies, click Add Forwarding Policy.

    Table 2 Forwarding policy

    Parameter

    Description

    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.

    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.

    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.

  7. Click OK.
  8. 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.

  9. (Optional) After the configuration, you can modify or delete the port configuration on the access mode page. After the modification or deletion, click Activate Settings in the upper part of the page for the configuration to take effect.

Verifying the Access Mode

  1. Choose Components, click the IP address (example: http://test-test-16.com:13456/) in the Access Address column of the component.
  2. The static web page of the component is displayed.

    Figure 1 Accessing a static page