{
  "TCP": {
<% if mode == "prod" %>
    "443": {
      "HTTPS": true
    }
<% elif mode == "dev" or tailscale.scheme == "http" %>
    "80": {
      "HTTPS": false
    }
<% endif %>
  },
  "Web": {
<% if mode == "prod" %>
    "${TS_CERT_DOMAIN}:443": {
      "Handlers": {
        "/": {
          "Proxy": "http://localhost:8080"
        }
      }
    }
<% elif mode == "dev" or tailscale.scheme == "http" %>
    "${TS_CERT_DOMAIN}:80": {
      "Handlers": {
        "/": {
          "Proxy": "http://localhost:8080"
        }
      }
    }
<% endif %>
  },
  "AllowFunnel": {
<% if mode == "prod" %>
    "${TS_CERT_DOMAIN}:443": false
<% elif mode == "dev" or tailscale.scheme == "http" %>
    "${TS_CERT_DOMAIN}:80": false
<% endif %>
  }
}