main.yaml — Startup Parameters

KeyExample ValueDescription
threads12Number of running daemon threads. Optional, defaults to 1
runuseraralezOptional. Username for running aralez after dropping root privileges (requires launch as root)
rungrouparalezOptional. Group for running aralez after dropping root privileges (requires launch as root)
daemonfalseRun in background (boolean)
upstream_keepalive_pool_size500Pool size for upstream keepalive connections
pid_file/tmp/aralez.pidPath to PID file
error_log/tmp/aralez_err.logPath to error log file
config_address0.0.0.0:3000HTTP API address for pushing upstreams.yaml from remote location
config_tls_address0.0.0.0:3001HTTPS API address for pushing upstreams.yaml from remote location
config_tls_certificateetc/server.crtCertificate file path for API
proxy_tls_gradehigh, medium, unsafeGrade of TLS ciphers. high matches Qualys SSL Labs A+ (defaults to medium)
config_tls_key_fileetc/key.pemPrivate Key file path
proxy_address_http0.0.0.0:6193Aralez HTTP bind address
proxy_address_tls0.0.0.0:6194Aralez HTTPS bind address (Optional)
proxy_certificatesetc/certs/Directory containing {NAME}.crt and {NAME}.key files
upstreams_confetc/upstreams.yamlLocation of the upstreams file
log_levelinfoLog level: info, warn, error, debug, trace, off
hc_methodHEADHealthcheck method: HEAD, GET, POST (UPPERCASE)
hc_interval2Interval for health checks in seconds
master_key5aeff7f9-…Master key for API server and JWT Secret generation
file_server_folder/some/local/folderOptional. Local folder to serve
file_server_address127.0.0.1:3002Optional. Local address for file server
config_api_enabledtrueEnable/disable remote config push capability

upstreams.yaml — Upstream Mappings


Example: File Provider

A sample upstreams.yaml entry:

provider: "file"
sticky_sessions: false
to_https: false
rate_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"
authorization:
  type: "jwt"
  creds: "910517d9-f9a1-48de-8826-dbadacbd84af-cb6f830e-ab16-47ec-9d8f-0090de732774"
myhost.mydomain.com:
  paths:
    "/":
      rate_limit: 20
      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
      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"

This means:


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.