Gateway

Serve an application over HTTPS from the WAF agent, with no web server in front of it. Visitors connect to the agent. It ends TLS, picks the application and its certificate from the host name, and runs the request through the WAF before it reaches your upstream. Gateway is off for every application until you turn it on, and an application with it off stays behind your web server or CDN as before.

VisitorHTTPSGatewayTLS, SNIWAF checksPolicyApplicationUpstreamBlockedWAF policyVisitorHTTPSGatewayTLS, SNIWAF checksPolicyApplicationUpstreamBlockedWAF policy
  • Request that passes
  • Request blocked

What it provides

  • HTTPS on the agent with TLS 1.2 and 1.3 and HTTP/1.1. The application and its certificate are picked from the host name in the handshake (SNI), and several applications can share one HTTPS address.
  • An optional HTTP address that redirects every request to HTTPS with a 308.
  • A main host name: a visitor who arrives under another host name of the application is redirected to it with a 308.
  • Certificates you upload (a PEM chain and an unencrypted key; RSA 2048 to 4096 bits, ECDSA P-256 or P-384), or Let’s Encrypt certificates that the agent orders and renews itself.
  • Renewal starts when a third of the certificate’s lifetime is left. A failed renewal keeps serving the current certificate and is tried again with longer waits.
  • Expiry alerts on the application page, and by mail to the project owners and members when the control plane has SMTP set.

How to use it

  1. Move any web server off the HTTPS port, then open the Gateway tab of the application and enter its host names and addresses.
  2. Choose the certificate: upload a chain and a key, or let the agent order one from Let’s Encrypt. Ports 80 and 443 must be reachable by everyone for Let’s Encrypt.
  3. Turn the switch on, read the checks that the dialog lists, and confirm. Then look at the certificate card for the state the agent reports.
Set addressesHost names, HTTPS, HTTPChoose certificateUpload or Let’s EncryptTurn it onCheck the certificate cardSet addressesHost names, HTTPS, HTTPChoose certificateUpload or Let’s EncryptTurn it onCheck the certificate card
  • Order of the steps

Configuration and operation

The Gateway tab is on the application page, between Maintenance and Speed. With the switch off, the tab says that requests reach the agent on the Routing listen address and that a web server or CDN in front of it handles HTTPS. An uploaded key is sealed in the control plane and sent only to the agent that serves the application, which needs a credential bound to its host. Behind Cloudflare, set SSL/TLS to Full and use HTTP-01.

Limits

The listener speaks HTTP/1.1 only, with no HTTP/2 yet. Host names are plain DNS names: no wildcard names, and no DNS-01 challenge. Let’s Encrypt needs ports 80 and 443 open to everyone, so a host firewall that lets only some addresses through makes the order fail. If another program holds the HTTPS port, the agent cannot bind it and tries again every minute. The server keeps a copy of an uploaded key: after you delete or revoke the host of the agent, upload a certificate with a different key.