sun-port is a high-performance reverse proxy built on Cloudflare's Pingora framework. This guide covers deploying it in a Docker container with host networking, TLS termination, and multi-domain routing.
Docker Container (--network host)
:80 → HTTP proxy (auto-redirect to HTTPS)
:443 → HTTPS termination (HTTP/2)
:9090 → Admin API + Web UI
cd /path/to/sun-port
cargo build --release
cp target/release/sun-port /opt/sun-port-run/
openssl req -x509 -newkey rsa:4096 \
-keyout certs/key.pem -out certs/cert.pem \
-days 365 -nodes -subj '/CN=your-domain.com'
proxy_bind: "0.0.0.0:80"
https_bind: "0.0.0.0:443"
admin_bind: "0.0.0.0:9090"
tls_cert_path: "/run/sun-port/certs/cert.pem"
tls_key_path: "/run/sun-port/certs/key.pem"
http_redirect: true
upstreams:
- name: my-app
servers: ["127.0.0.1:3000"]
routes:
- path_prefix: "/"
upstream: my-app
docker run -d --name sunp --network host \
-v /opt/sun-port-run:/run/sun-port \
-w /run/sun-port \
debian:bookworm-slim \
/run/sun-port/sun-port /run/sun-port/config.yaml
ss -tlnp | grep -E ':80 |:443'
curl -sk https://localhost/
curl http://localhost:9090/api/health