Skip to content

Virtual servers Since v0.1 ​

A virtual server is a VIP plus a port, a protocol (http or https) and TLS settings. It is where clients connect. An application attaches to one or more virtual servers. The configuration key and the API keep the older name listeners (/v1/listeners), so existing configurations and scripts keep working.

Before you begin ​

  • Role: global operator or admin to change virtual servers.
  • For https, an application certificate on the application that uses the virtual server.
  • A VIP, or an address you type inline.

Add a virtual server ​

text
1. Open Traffic > Virtual servers.
2. Select a VIP and enter a Port, or type an inline Address (IP:port). Use one form, not both.
3. Choose the Protocol and, for https, the Lowest TLS version.
4. Select Preview changes, add a comment and select Apply.
sh
waap listeners add -listener vs-shop -vip vip-shop -port 443 -protocol https -tls-min 1.3 -m "shop https"
waap listeners add -listener legacy -address 127.0.0.1:8080 -m "inline address"
yaml
# listeners[] in the configuration
- {name: vs-shop, vip: vip-shop, port: 443, protocol: https, tls: {min_version: "1.3"}}
- {name: legacy, address: "127.0.0.1:8080", protocol: http}

Remove one with waap listeners remove -listener NAME. listeners get prints the current list as YAML and listeners set -f FILE replaces it. Every command accepts -m WHY and -dry-run.

Attach an application ​

Name the virtual server in the application's Listening addresses.

yaml
applications:
  - {name: shop, listeners: [vs-shop], server_pool: shop}

An application that is the only one on every virtual server it uses may leave hostnames empty. It then answers any host name, and its TLS entry has no server-name match. When a virtual server is shared, every application on it needs host names.

Settings reference ​

SettingWhat it doesDefaultAllowed valuesApplies in
Name (name)Identifies the virtual server.nonelowercase letters, digits and dashes; 1 to 63 charactersall
VIP (vip)The named address to listen on.nonean existing VIPwith Port; not with Address
Port (port)The TCP port on the VIP.none1 to 65535with VIP only
Address (inline) (address)An IP:port instead of a VIP.nonefor example 0.0.0.0:443 (0.0.0.0 means every address of the machine)without VIP
Protocol (protocol)Plain or TLS traffic.httphttp, httpsall
Lowest TLS version (tls.min_version)The oldest TLS version accepted.1.21.2, 1.3https only

Rules ​

  • Two virtual servers cannot share an address and port.
  • Removing a virtual server that an application uses is refused (HTTP 409), and the message names the application.
  • https needs an application certificate; upload it on the application's Certificates page, or with waap apps cert set -app NAME -cert FILE -key FILE.
  • Client addresses behind a proxy come from X-Forwarded-For only for the networks under Traffic > Trusted proxies (waap trusted-proxies set -m WHY CIDR...).

Troubleshooting ​

Clients cannot connect on a lab VIP on macOS. Cause: macOS answers only 127.0.0.1 until loopback aliases exist. Fix: run make demo-vips once per boot (needs sudo). Linux needs nothing.

An https virtual server is refused. Cause: no application certificate. Fix: upload one.