ā” High-performance reverse proxy with Auto-SSL, HTTP/2, and 6 LB algorithms. Built with Rust.
10K+
Zunikā is a lightweight, high-performance reverse proxy & load balancer written in Rust. Drop-in replacement for nginx/traefik with Auto-SSL and zero downtime reload.
Key Features:
include + --config-dir)Create config.toml:
[server]
http_listen = "0.0.0.0:80"
[dashboard]
enabled = true
listen = "0.0.0.0:8080"
[routes.app]
enabled = true
[routes.app.match_rule]
path_prefix = "/"
[[routes.app.backends]]
url = "http://your-backend:3000"
Run with Docker:
Single config file:
docker run -d --name zunik \
-p 80:80 -p 8080:8080 \
-v $(pwd)/config.toml:/app/config.toml:ro \
zunohan/zunik:latest
Config directory:
docker run -d --name zunik \
-p 80:80 -p 8080:8080 \
-v $(pwd)/config/:/app/config/:ro \
zunohan/zunik:latest
š” Smart config: Zunik auto-detects
config.tomlorconfig/dir. No flags needed.
Access the Dashboard at http://localhost:8080
[server]
http_listen = "0.0.0.0:80"
https_listen = "0.0.0.0:443"
[server.auto_ssl]
domains = ["example.com"]
email = "[email protected]"
docker run -d --name zunik \
-p 80:80 -p 443:443 \
-v $(pwd)/config.toml:/app/config.toml:ro \
-v zunik-certs:/app/certs \
zunohan/zunik:latest
services:
zunik:
image: zunohan/zunik:latest
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- ./config.toml:/app/config.toml:ro
- zunik-certs:/app/certs
restart: unless-stopped
backend:
image: your-app:latest
expose:
- 3000
volumes:
zunik-certs:
[routes.api]
load_balancing = "least_connections"
[routes.api.match_rule]
path_prefix = "/api"
[[routes.api.backends]]
url = "http://api-1:3000"
weight = 3
[[routes.api.backends]]
url = "http://api-2:3000"
weight = 1
[routes.api.health_check]
interval_secs = 10
path = "/health"
timeout_secs = 5
Supported algorithms: round_robin, weighted_round_robin, random, ip_hash, least_connections, least_response_time
[routes.web]
[routes.web.match_rule]
host = "myapp.com"
[[routes.web.backends]]
url = "http://frontend:3000"
[routes.api]
priority = 10
[routes.api.match_rule]
host = "api.myapp.com"
[[routes.api.backends]]
url = "http://api:3000"
Split configs per service, similar to nginx sites-enabled/:
zunik --config-dir ./config/
config/
āāā 00-server.toml
āāā 01-users.toml
āāā 02-orders.toml
āāā 03-products.toml
With Docker:
services:
zunik:
image: zunohan/zunik:latest
command: ["--config-dir", "/app/config/"]
volumes:
- ./config/:/app/config/:ro
Files are loaded in alphabetical order ā use prefixes 00-, 01-... to control order.
services:
zunik:
image: zunohan/zunik:latest
command: ["--config-dir", "/app/config/"]
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- /path/to/config/:/app/config/:ro
- zunik-certs:/app/certs
deploy:
mode: global
networks:
- proxy
networks:
proxy:
driver: overlay
attachable: true
volumes:
zunik-certs:
# CORS
[[routes.api.middlewares]]
type = "cors"
allowed_origins = ["*"]
allowed_methods = ["GET", "POST", "PUT", "DELETE"]
# Compression
[[routes.api.middlewares]]
type = "compress"
# Basic Auth
[[routes.api.middlewares]]
type = "basic_auth"
[routes.api.middlewares.users]
admin = "password123"
# HTTPS Redirect
[[routes.api.middlewares]]
type = "redirect_https"
# Strip Prefix
[[routes.api.middlewares]]
type = "strip_prefix"
prefix = "/api"
Available: add_headers, cors, strip_prefix, add_prefix, basic_auth, compress, redirect_https, rewrite_path
| Path | Description |
|---|---|
/app/config.toml | Configuration file |
/app/config/ | Config directory (multi-file) |
/app/certs/ | SSL certificates |
| Port | Description |
|---|---|
80 | HTTP |
443 | HTTPS |
8080 | Admin Dashboard & API |
| Endpoint | Description |
|---|---|
GET / | Web Dashboard |
GET /api/metrics | Request metrics |
GET /api/config | Current config |
GET /api/health | Backend health status |
docker run -e RUST_LOG=zunik=debug zunohan/zunik:latest
Full documentation and source code: https://github.com/zuno90/zunikā
If you find Zunik useful, consider buying me a coffee!
MIT
Content type
Image
Digest
sha256:5989bce0eā¦
Size
37 MB
Last updated
about 1 month ago
docker pull zunohan/zunik