This topic uses NGINX as an example to describe how to collect logs from servers in a corporate intranet to Log Service.
Prerequisites
A project and a Logstore are created. For more information, see Create a project and Create a Logstore.
Background information
For example, you deployed multiple servers in a corporate intranet, and the servers do not have access to the Internet. If you want to collect logs from the servers to Log Service for query and analysis, you can authorize one of the servers to access the Internet. Then, you can configure this server as a gateway server. This way, you can collect logs from the other servers to Log Service.
You can configure a reverse proxy server, such as NGINX, as the gateway server. NGINX is an open source and high-performance HTTP server and reverse proxy server. For more information, visit the official NGINX website.
Working principle
- The endpoints that start with
logtail
. Format:logtail.${region}.log.aliyuncs.com
. Example:logtail.cn-beijing.log.aliyuncs.com
. This type of endpoint is used for communication that involves control-related requests. - The endpoints that start with a project name. Format:
${project_name}.${region}.log.aliyuncs.com
. Example:project_example.cn-beijing.log.aliyuncs.com
. This type of endpoint is used for communication that involves data-related requests. - The endpoints that start with
ali-${region}-sls-admin
. Format:ali-${region}-sls-admin.${region}.log.aliyuncs.com
. Example:ali-cn-beijing-sls-admin.cn-beijing.log.aliyuncs.com
. This type of endpoint is used to report monitoring data.
In the preceding formats, ${region}
specifies the region of the project that is used, and ${project_name}
specifies the name of the project.

Step 1: Enable anonymous write
Submit a ticket to enable anonymous write.
Step 2: Configure a gateway server
The following procedure describes how to use NGINX to configure a server that has access to the Internet in a corporate intranet as a gateway server:
Step 3: Bind the gateway server to the servers in the corporate intranet
After you configure the gateway server, you must bind the gateway server to the servers in the corporate intranet.
Step 4: Test network connectivity
FAQ
If issues occur during collection, you can submit a ticket to contact technical support.