# 向监听器添加后端服务器

后端服务器接收监听器转发的流量。您可以通过以下任一方式配置后端服务器：

* **按实例**：直接从现有弹性计算实例中选择后端服务器。
* **按 IP 地址**：手动指定后端服务器的 IP 地址。

监听器创建完成后，您可以在监听器列表页选择 **Actions** > **Add Backend Server** 向监听器添加后端服务器。

### 按实例

**按实例**添加后端服务器时，您直接从资源列表中选择计算实例。后端服务运行在云实例上，管理方式更加简洁，符合云原生管理模式。

#### 实例

选择要添加的弹性计算实例。

实例与负载均衡器必须位于同一全局 VPC 下的同一地区子网中。

#### 私有 IPv4

弹性计算实例的私有 IP 地址，供监听器用于请求转发和健康检查。

#### 端口

请求转发和健康检查的目标端口。

仅可指定 `1` 至 `65535` 范围内的一个端口。如为空，将沿用监听端口配置。

#### 权重

分配给每台后端服务器的请求比例。权重越高，服务器接收的请求越多。

权重范围为 `0` 至 `65535`，默认权重为 `100`。权重为 `0` 表示该服务器不接受新请求。

点击 **Add Backend Server** 可添加更多后端服务器。

### 按 IP 地址

**按私有 IP** 添加后端服务器时，您手动指定后端服务器的私有 IP 地址。后端服务器**仅通过 IP** 进行标识。这是一种更灵活的基于 IP 的配置方式。

#### 私有 IPv4

弹性计算实例的私有 IP 地址，供监听器用于请求转发和健康检查。

#### 端口

请求转发和健康检查的目标端口。

仅可指定 `1` 至 `65535` 范围内的一个端口。如为空，将沿用监听端口配置。

#### 权重

分配给每台后端服务器的请求比例。权重越高，服务器接收的请求越多。

权重范围为 `0` 至 `65535`，默认权重为 `100`。权重为 `0` 表示该服务器不接受新请求。

点击 **Add Private IPv4** 可添加更多私有 IPv4 地址。

{% hint style="success" %} <mark style="color:green;">**提示**</mark>

<mark style="color:green;">您也可以在详情页前往</mark> <mark style="color:green;">**Backend server list**</mark> <mark style="color:green;">></mark> <mark style="color:green;">**Actions**</mark> <mark style="color:green;">></mark> <mark style="color:green;">**Remove**</mark> <mark style="color:green;">移除后端服务器。</mark>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/cn/elastic-compute/load-balancing/add-backend-servers-to-a-listener.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
