What does the "Use Frontend Port" option do?
Short answer
While Use Frontend Port is on, on HTTP and L7 TCP vServices TR7 connects to the Backend Service not on the port in the Address field but on the vService port on which the request arrived. On a vService that listens on more than one port (e.g. 80 and 443, or SMTP's 25 and 587), it is used so that each connection goes to the same port on the server; this way there is no need to define a separate Backend Service for each port. Its default value is off; even while it is on, the health check probes the port in the Address field.
How Does It Work?
| Use Frontend Port off (default) | Use Frontend Port on | |
|---|---|---|
| Port used to connect to the Backend Service | The port in the Address field | The vService port the client connected to |
| vService listening on 80 and 443 | Both go to the Address port (e.g. 8080) | What arrives on 80 goes to 80, what arrives on 443 goes to 443 |
When Is It Used?
- The vService listens on more than one port, and the server itself listens on the same ports (e.g. SMTP 25/587).
- The number of ports is very large, and defining a separate Backend Service for each one is not practical.
It is left off on single-port vServices or when port translation (443 → 8080) is wanted.
In TR7
- Location: Load Balancer → Backend Services → Add or Edit → Details switch → Use Frontend Port; it is saved with the form button. In a Backend Group, it is at the group level (Backend Groups · Use Frontend Port).
- WEB-CLI: On an existing record,
lb backend update id <id> --useFrontendPort true(WEB-CLI · lb backend · The Traffic and Distribution Fields). - Health check: Even while it is on, the health check probes the port in the Address field (if a separate address is given with Use Different IP for Health Check, it probes that address); therefore, the Address port must be a port on which the server actually listens.
- Preview: In the Details tab of the Backend Service's preview panel, the Use Frontend Port row appears only while the setting is on.
- Network vService: On Network vServices, this setting has no effect; the port behavior is determined by the vService's Port Range, Protocol and LB Mode settings.
- Cluster: While Clustering is on and Manual Sync Mode is off (default), the setting is transferred to the peer device automatically.
Common Misconceptions
- "While it is on, the Address port can be left empty." The Address port is still required; in addition, the health check uses this port.
- "It is turned on to translate 443 to 8080." The opposite; while it is on, no translation is made, and the request goes to the port on which it arrived. For port translation, it is left off.
- "The health check also probes the vService port." The health check probes the Address port.
- "It also works on a Traffic Mirror target." In the Traffic Mirroring action, a Backend Service with Use Frontend Port on can be selected as the Mirror Target Service, but mirror traffic is not sent to this target. For the mirror target, a separate Backend Service whose port is written in the Address field and with Use Frontend Port off is used.
How it is done in the documentation
