lb trusted-proxy
The lb trusted-proxy command creates the trusted proxy profiles that determine from which header the real address of the client will be read and in the requests coming from which networks this header will be trusted. Its panel equivalent is the Trusted Proxy screen.
If there is a load balancer, a CDN or a proxy server in front of TR7, since the connection comes from that device, the source address becomes its address. The real client address is carried in a header; this profile says in which situation that header will be taken into account.
Command Summary
Required Fields
| Order | Field | Status | Value |
|---|---|---|---|
| 1 | name | Required | The name of the profile; it must be unique in the collection |
The Source Definitions
Every source defines together from where the real address will be read and which networks will be trusted. The sources are written with their own indexes.
| Field | What it does | What is written after it |
|---|---|---|
--sources.N.type | Selects from where the real address will be taken | xffLast the last address in the X-Forwarded-For header · xffFirst the first address · customHeader another header |
--sources.N.headerName | Determines the header from which the address will be read | The header name; it opens only when --sources.N.type customHeader is selected |
--sources.N.trustedNetworks.M.ip | Determines in the requests coming from which network this source will be trusted | A network address; every network with its own index |
--sources.N.trustedNetworks.M.cidr | Determines the mask length of the network | A CIDR value, for example 24 |
The header should not be trusted without a trusted network being given
The address header can be written by the client as well. The trusted network list makes the header be taken into account only in the requests coming from the known proxy servers.
Examples
Updating and Deleting
Things to Know
- A profile does not work on its own. The address reading comes into play when the profile is bound to a vService with the
--trustedProxyfield. This field is found only in the vServices of the HTTP type. - More than one source can be defined. Separate sources are written for the traffic coming by different ways, such as a CDN and an internal load balancer.
- The header name is asked for only in the custom source. When
xffLastorxffFirstis selected, the header is already X-Forwarded-For. - The name is unique. A second profile with the same name cannot be created.
