Environment Variables

VariableDefaultDescription
PORT8080HTTP listen port
REDIS_ADDRlocalhost:6379Redis server address
REDIS_PASSWORD(empty)Redis auth password
REDIS_DB0Redis database number
HEARTBEAT_TTL15sTime-to-live for registered instances
CLEANUP_INTERVAL5sHow often to check for expired instances
REQUEST_TIMEOUT30sHTTP read/write timeout
PROXY_MODEfalseEnable reverse proxy mode (instead of 302 redirect)
PROXY_TIMEOUT30sBackend connection timeout in proxy mode
PROXY_IDLE_CONNS100Max idle connections in the transport pool
PROXY_IDLE_PER_HOST10Max idle connections per backend host

Examples

Redirect mode (default, internal networks)

export PORT=9090
export REDIS_ADDR=redis-cluster:6379
export HEARTBEAT_TTL=30s
export PROXY_MODE=false

./bin/flux

Proxy mode (behind Nginx, HTTPS)

export PORT=8080
export REDIS_ADDR=redis:6379
export PROXY_MODE=true
export PROXY_IDLE_CONNS=200
export PROXY_IDLE_PER_HOST=50

./bin/flux

Default Port

flux listens on 8080 by default. Override with PORT:

PORT=9090 ./bin/flux