add load balancing strategy

This commit is contained in:
miloschwartz
2026-10-20 12:20:43 -04:00
parent 28da1deb48
commit d58a2bc9cd
4 changed files with 35 additions and 12 deletions
+4 -2
View File
@@ -285,7 +285,7 @@ When a resource is targets-only, `name` and `mode` are not required.
### Load Balancing Example
When a resource has more than one target, `load-balancing-strategy` controls how requests are spread across them.
When an HTTP resource has more than one target, `load-balancing-strategy` controls how requests are spread across them. The same options are available on the resource **Proxy** tab. See [Load Balancing Strategy](/manage/resources/public/targets#load-balancing-strategy).
```yaml
public-resources:
@@ -312,6 +312,8 @@ Strategy values:
- **`hrw`**: Client IP hash. The same client IP is consistently routed to the same target.
- **`leasttime`**: Least response time. Requests go to the target with the fastest response time and fewest active connections.
TCP/UDP (`mode: tcp` / `mode: udp`) resources ignore this field and always use round robin.
### Identity Headers Example
By default, Pangolin forwards the authenticated user's identity to the backend in the `Remote-User`, `Remote-Email`, `Remote-Name`, `Remote-Role`, and `Remote-User-Id` headers. Set `forward-identity-headers: false` to stop sending them, for example when the backend should not see user details. See [Forwarded Headers](/manage/access-control/forwarded-headers).
@@ -1017,7 +1019,7 @@ public-resources:
</ResponseField>
<ResponseField name="load-balancing-strategy" type="string">
How requests are distributed across the resource's targets.
How requests are distributed across the resource's targets. Applies to HTTP resources only; TCP/UDP always use round robin. See [Load Balancing Strategy](/manage/resources/public/targets#load-balancing-strategy).
- `wrr`: Round robin. Requests rotate evenly across targets.
- `p2c`: Power of two choices. Pick two random targets and send the request to the one with fewer active connections.