MyNixOS website logo
option

services.tlsrouter.routes

TLSRouter requires a configuration that tells it what backend to use for a given hostname.

Declarations
Type
attribute set of (submodule)
Example
{
  # Basic hostname -> backend mapping
  "go.universe.tf".backend = "localhost:1234";

  # DNS wildcards are understood as well.
  "*.go.universe.tf".backend = "1.2.3.4:8080";

  # DNS wildcards can go anywhere in name.
  "google.*".backend = "10.20.30.40:443";

  # RE2 regexes are also available
  "/(alpha|beta|gamma)\\.mon(itoring)?\\.dave\\.tf/".backend = "100.200.100.200:443";

  # If your backend supports HAProxy's PROXY protocol, you can enable
  # it to receive the real client ip:port.
  "fancy.backend" = {
    backend = "2.3.4.5:443";
    proxy = true;
  };
}