Applications running on TEM usually need to access the public network for business and other reasons. In many cases, these requests are all HTTP/HTTPS requests. You can use API Gateway to easily access HTTP/HTTPS requests from the public network through simple configuration.
If your access to the public network does not only include HTTP/HTTPS, refer to Public Network Access of TEM Applications to configure a NAT gateway for implementation.
Create an environment and create and deploy an application.
Step 1. Associate public network HTTP/HTTPS requests in API Gateway
- Log in to the API Gateway console and click Service on the left sidebar to enter the service list page.
- Select the same region as the TEM application and click Create in the top-left corner to create a service.
When creating the service, you can select the frontend type (HTTP, HTTPS, or HTTP/HTTPS), access mode (VPC), and instance type (shared).
- Click the API Gateway service ID to enter the API management page and click Create API.
- In the Frontend Configuration step, enter the API name, select HTTP&HTTPS as the frontend type, / as the path, ANY as the request method (to include all requests), and No authentication as the authentication type, and click Next.
- In the Backend Configuration step, select Public URL/IP as the backend type, configure the public domain name and path you need to access (Tencent Cloud official website is used as an example here), and click Next.
- Set the return type of the application (which is HTML here), select JSON as the RESTful service, and click Complete to publish the service.
Step 2. Verify public network request connectivity
- Go to the API Gateway service's basic configuration page and copy its VPC access address.
- Open the deployed TEM application page, enter the webshell of the application instance, and visit the API Gateway VPC access address to verify the network connectivity.