Features
Features
Rate Limiting
Nvelox provides two levels of rate limiting:
- Connection rate limiting — at the listener level via
rate_limit(connections/sec) - Per-IP request rate limiting — at the listener level via
ip_rate_limit(requests/sec + burst)
listeners:
- name: https_public
protocol: https
bind: ":8443"
tls:
cert: /etc/nvelox/tls/server.crt
key: /etc/nvelox/tls/server.key
ip_rate_limit:
requests_per_second: 100
burst: 200
listeners:
- name: tcp_api
protocol: tcp
bind: ":8080"
rate_limit:
connections_per_second: 50
burst: 100
Circuit Breaker
Prevent cascading failures by tripping a circuit when backend error rates exceed a threshold. The breaker transitions through three states:
- Closed — Normal operation, requests flow freely
- Open — Requests are rejected immediately (fast fail)
- Half-Open — Limited probe requests (
half_open_max) to test recovery
enabled— Enable circuit breakerthreshold— Error percentage to trip the circuittimeout— Time in open state before transitioning to half-openhalf_open_max— Probe requests allowed in half-open state
backends:
- name: api_servers
balance: roundrobin
circuit_breaker:
enabled: true
threshold: 50 # 50% failure rate trips the circuit
timeout: 60s # stay open for 60s before half-open
half_open_max: 3 # allow 3 probe requests
servers:
- "10.0.1.10:8080"
Response Caching
Cache backend responses in memory with TTL-based expiration. Configured per listener.
enabled— Enable cachingmax_size— Maximum cache size (e.g.256MB)default_ttl— Time-to-live for cached entriesmethods— HTTP methods to cache (default: GET)
listeners:
- name: https_public
protocol: https
bind: ":8443"
tls:
cert: /etc/nvelox/tls/server.crt
key: /etc/nvelox/tls/server.key
cache:
enabled: true
max_size: 256MB
default_ttl: 300s
methods:
- GET
Compression
Reduce bandwidth with automatic response compression. Configured per listener.
enabled— Enable compressiontypes— Content types to compressmin_length— Minimum response size to compress (bytes)
listeners:
- name: https_public
protocol: https
bind: ":8443"
tls:
cert: /etc/nvelox/tls/server.crt
key: /etc/nvelox/tls/server.key
compression:
enabled: true
types:
- text/html
- application/json
- text/css
- application/javascript
min_length: 1024
Lua Scripting
Embed custom Lua scripts for advanced request/response manipulation. Scripts run in a sandboxed Lua VM with hooks at key points in the request lifecycle. Configure per-route using scripts.
request_script— Path to Lua script for request modificationresponse_script— Path to Lua script for response modification
listeners:
- name: https_public
protocol: https
bind: ":8443"
tls:
cert: /etc/nvelox/tls/server.crt
key: /etc/nvelox/tls/server.key
routes:
- match:
path_prefix: /api/
backend: api_servers
scripts:
request_script: /etc/nvelox/scripts/modify_request.lua
response_script: /etc/nvelox/scripts/log_response.lua
WebSocket Proxying
Nvelox transparently handles WebSocket upgrades on HTTP/HTTPS listeners. No special configuration is needed — upgrade requests are detected automatically and the connection is bidirectionally proxied.
listeners:
- name: https_public
protocol: https
bind: ":8443"
tls:
cert: /etc/nvelox/tls/server.crt
key: /etc/nvelox/tls/server.key
routes:
- match:
path_prefix: /ws/
backend: ws_servers
# WebSocket upgrade is handled automatically
Access Logging
Configure access and error log output paths in the top-level logging section.
level— Log level (debug, info, warn, error)access_log— Path to access log fileerror_log— Path to error log file
logging:
level: info
access_log: /var/log/nvelox/access.log
error_log: /var/log/nvelox/error.log