main.yaml — Startup Parameters

KeyExample ValueDescription
threads12Number of worker threads assigned to proxy operations. Defaults to 1.
runuseraralezOptional. Username to run as after dropping root privileges (requires launch as root).
rungrouparalezOptional. Group to run as after dropping root privileges (requires launch as root).
cacheOptional BlockIf omitted entirely, caching is disabled.
cache.storagehybridStorage backend: "memory", "hybrid", "redis://host:port", or "tikv://host1:port,host2.port". Defaults to "memory".
cache.mem_size_mb64Optional. Memory cache tier limit in megabytes. Defaults to 64.
cache.file_size_mb128Optional. Disk cache tier limit in megabytes (hybrid mode). Defaults to 512.
cache.file_path/tmp/cacheOptional. Directory path for the disk cache tier. Defaults to /tmp/aralez_cache.
cache.item_max_size5Optional. Maximum allowed size for a single cached item in megabytes. Defaults to 5.
cache.flush_interval60Optional. Interval in seconds to flush memory cache states to disk (hybrid mode). Defaults to 60.
cache.ttl300Optional. Default TTL in seconds used when upstream Cache-Control headers are absent. Defaults to 300.
upstream_keepalive_pool_size500Maximum number of keepalive connections pooled for upstream targets.
pid_file/tmp/aralez.pidFile system path where the daemon process ID is written.
error_log/tmp/aralez_err.logOptional. File path for directing standard error log output when enabled.
upgrade_sock/tmp/aralez.sockUnix domain socket path used for zero-downtime binary upgrades and state handoffs.
config_api_enabledtrueBoolean toggle to enable/disable remote runtime configuration push capability.
config_address0.0.0.0:3000HTTP API bind address for pushing runtime config updates.
proxy_address_http0.0.0.0:6193Primary bind address and port for incoming plain-text HTTP proxy traffic.
proxy_address_tls0.0.0.0:6194Optional bind address and port for incoming secure TLS proxy traffic.
proxy_configs/etc/aralezPath to directory containing SSL certs and keys in format {NAME}.crt and {NAME}.key.
upstreams_conf/etc/aralez/upstreams.yamlFile system path pointing to upstream service routing definitions.
proxy_tls_gradehighSecurity grade of TLS cipher suite (high, medium, unsafe). high matches Qualys SSL Labs A+.
file_server_folder/opt/publicOptional. Local file system directory to serve statically.
file_server_address0.0.0.0:3002Optional. Local bind address for static file server.
log_levelinfoGlobal logging verbosity threshold (info, warn, error, debug, trace, off).
access_logallAccess logging mode (all, error). Omit/comment out to disable.
log_pattern{d(%Y-%m-%d %H:%M:%S)} {h({l})} - {t} - {m} {n}Optional custom log pattern. Defaults to {d(%Y-%m-%d %H:%M:%S)} {l} - {m}{n}.
log_file/tmp/aralez.log, 20, 5, compressOptional file logging config: path, max size (MB), rotated files to keep, compression.
log_structuredelasticsearchOptional structured logging sink target (e.g., elasticsearch).
acme_dns_providercloudflareDNS provider API integration for automated ACME DNS-01 challenges (cloudflare, route53, digitalocean).
hc_methodHEADHTTP health check method verb (HEAD, GET, POST in UPPERCASE).
hc_interval5Time interval in seconds between periodic upstream health checks.
cluster_membermasterOptional. Operational role in multi-node cluster mode (master, worker).
worker_nodeshttp://127.0.0.1:8000, http://127.0.0.1:4000Required if cluster_member: master. Comma-separated worker management endpoints.
tcpOptional BlockOptional advanced Linux TCP socket parameters. Do not alter unless tuned for specific network environments. Values shown act as operational defaults.
tcp.tcp_keepalive_idle30Seconds of socket inactivity before sending TCP keepalive probes. Defaults to 30.
tcp.tcp_keepalive_interval10Seconds between individual keepalive probes if no response. Defaults to 10.
tcp.tcp_keepalive_count5Maximum unanswered probes before declaring connection dead. Defaults to 5.
tcp.so_reuseporttrueEnables SO_REUSEPORT for multi-worker connection distribution without lock contention. Defaults to true.
tcp.tcp_fastopen4096Enables TCP Fast Open backlog queue size. Set to 0 if unsupported by host kernel/container. Defaults to 4096.

Cluster Mode

Cluster mode is designed for high loaded career proxy farms where hundreds, or thousands of upstreams are configures and there is need to offload heavy health checks and type detections. Currently, a single master is supported, Master consensus with full RAFT implementation is planned.

Cache Documentation


Logging Documentation


upstreams.yaml — Upstream Mappings


Example: File Provider

A sample upstreams.yaml entry:

provider: "file"
sticky_sessions: 86000
to_https: false
rate_limit: 20
x4xx_limit: 10
server_headers:
  - "X-Forwarded-Proto:https"
  - "X-Forwarded-Port:443"
client_headers:
  - "Access-Control-Allow-Origin:*"
  - "Access-Control-Allow-Methods:POST, GET, OPTIONS"
  - "Access-Control-Max-Age:86400"
myhost.mydomain.com:
  paths:
    "/":
      rate_limit: 20
      x4xx_limit: 10
      to_https: false
      server_headers:
        - "X-Something-Else:Foobar"
        - "X-Another-Header:Hohohohoho"
      client_headers:
        - "X-Some-Thing:Yaaaaaaaaaaaaaaa"
        - "X-Proxy-From:Hopaaaaaaaaaaaar"
      servers:
        - "127.0.0.1:8000"
        - "127.0.0.2:8000"
    "/foo":
      to_https: true
      authorization:
        type: "jwt"
        data: "266463d1-210a-4787-9a81-4aacb37a8723"
      client_headers:
        - "X-Another-Header:Hohohohoho"
      servers:
        - "127.0.0.4:8443"
        - "127.0.0.5:8443"
    "/.well-known/acme-challenge":
      healthcheck: false
      servers:
        - "127.0.0.1:8001"
DEFAULT:
  paths:
    "/":
      servers:
        - "127.0.0.1:3000"

This means:

Special note if healthcheks are disabled.

Aralez internally detects upstreams TLS, H2, gRPS status during healtchecks. With disabled healtchecks is_http2 and is_ssl defaults to false. Fix these settings manually in accordance tou your upstreams server’s protocols inside upstreams.yaml

Example

  www.yourdomain.com:
    paths:
      "/":
        healthcheck: false
        is_http2: true
        is_ssl: true
        servers:
          - "127.0.0.1:443"

Since Version v.0.86.1 upstream config can be split to multiple files. Aralez will scan conf.d subdirectory in configuration directory and include all yaml files. Naming of files is not matter, it just needs to have extension .yaml . The content of file is similar to upstreams.yaml file with some minor differences .

  1. This is per host config file , so no global parameters whould be included
  2. hostname is the top level item in .yaml file
  3. Each file can contain one or multiple hosts.
  4. All valid host level parameters from upstreams.yaml are also valid here.
  5. In case of conflicting configuration parameters split file wins.
  6. If multiple split files contains the same host, the last applied wins.
  7. Files are applied in alphabetical order.
  8. Split files are read only is there is at least one configured upstream in main upstreams.yaml . If upstreams.yaml contains no upstreams at all, split files will be ignored.

Example: Split file

some.example.com:
  paths:
    "/":
      rate_limit: 100
      to_https: false
      server_headers:
        - "Y-Proxy-Server-From:Aralez"
      client_headers:
        - "Access-Control-Allow-Origin:*"
        - "Access-Control-Allow-Methods:POST, GET, OPTIONS"
        - "Access-Control-Max-Age:86400"
        - "Strict-Transport-Security:max-age=31536000; includeSubDomains; preload"
      authorization:
        type: "basic"
        data: "admin:admin"
      servers:
        - "127.0.0.1:8000"
        - "127.0.0.2:8000"
other.example.com:
  paths:
    "/":
      redirect_to: "https://some.example.com:6194"
      healthcheck: false
      servers:
        - "127.0.0.3:8000"

Example: Kubernetes & Consul Provider

provider: "kubernetes" # or "consul"
sticky_sessions: false
to_https: false
rate_limit: 100
server_headers:
  - "X-Forwarded-Proto:https"
  - "X-Forwarded-Port:443"
client_headers:
  - "Access-Control-Allow-Origin:*"
  - "Access-Control-Allow-Methods:POST, GET, OPTIONS"
  - "Access-Control-Max-Age:86400"
consul:
  servers:
    - "http://consul1:8500"
  services:
    - hostname: "nconsul"
      upstream: "nginx-consul-NginX-health"
      path: "/one"
      client_headers:
        - "X-Some-Thing:Yaaaaaaaaaaaaaaa"
        - "X-Proxy-From:Aralez"
      rate_limit: 1
      to_https: false
    - hostname: "nconsul"
      upstream: "nginx-consul-NginX-health"
      path: "/"
  token: "8e2db809-845b-45e1-8b47-2c8356a09da0-a4370955-18c2-4d6e-a8f8-ffcc0b47be81"
kubernetes:
  servers:
    - "172.16.0.11:5443"
  services:
    - hostname: "api-service"
      path: "/"
      upstream: "api-service"
    - hostname: "api-service"
      upstream: "console-service"
      path: "/one"
      client_headers:
        - "X-Some-Thing:Yaaaaaaaaaaaaaaa"
        - "X-Proxy-From:Aralez"
      rate_limit: 100
      to_https: false
    - hostname: "api-service"
      upstream: "feed-service"
      path: "/two"
    - hostname: "websocket-service"
      upstream: "websocket-service"
      path: "/"
  tokenpath: "/opt/Rust/Projects/asyncweb/etc/kubetoken.txt"

Mandatory Fields (Consul & Kubernetes)

- hostname: "api-service"
  upstream: "api-service"

Where hostname is the Host header to access the service and upstream is the service name in Consul or Kubernetes.

Optional Fields

FieldDescription
pathURL path to proxy to upstreams
client_headersList of additional response headers
server_headersList of additional request headers for upstreams
rate_limitRate limiter, number of requests per second
to_httpsRedirect to HTTPS

Consul-only

token: "8e2db809-..."

Consul auth token — mandatory if Consul auth is enabled.

servers:
  - "http://consul1:8500"

List of Consul servers — mandatory for Consul.

Kubernetes-only

tokenpath: "/opt/Rust/Projects/asyncweb/etc/kubetoken.txt"

For development only. Defaults to /var/run/secrets/kubernetes.io/serviceaccount/token. Remove for production.

servers:
  - "172.16.0.11:5443"

Defaults to environment variables KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT_HTTPS. For development only — delete for production use.