zintrust/zintrust-proxy-gateway

By zintrust

Updated 4 months ago

Nginx gateway for the ZinTrust proxy stack — routes MySQL, Postgres, Redis, SMTP and more.

Image
Networking
API management
Web servers
0

2.4K

zintrust/zintrust-proxy-gateway repository overview

ZinTrust Proxy Gateway — zintrust/zintrust-proxy-gateway

The ZinTrust Proxy Gateway is a high-performance Nginx reverse proxy that acts as the single entry point for all protocol-aware proxy services in the ZinTrust proxy stack. It routes HTTP requests to the correct backing proxy container (MySQL, PostgreSQL, Redis, MongoDB, SQL Server, or SMTP) and provides failover, keep-alive connection reuse, and a unified health endpoint.

Companion image: zintrust/zintrust-proxy — the Node.js runtime image for each individual protocol proxy.


What's inside

ComponentDetail
Basenginx:1.27-alpine
Listen port8080
Archlinux/amd64, linux/arm64
Worker connections8 192 per worker
Max open files200 000

Routing table

Path prefixProxied toDefault port
/mysql/*proxy-mysql8789
/postgres/*proxy-pg8790
/redis/*proxy-redis8791
/mongodb/*proxy-mongodb8792
/sqlserver/*proxy-sqlserver8793
/smtp/*proxy-smtp8794
/healthBuilt-in (gateway self)

The path prefix is stripped before forwarding, so /mysql/health is received by the MySQL proxy as /health.


Key features

  • Single entry point — one exposed port (8800 by default) for all proxy traffic.
  • Automatic failover — retries up to 3 times on error, timeout, 502, 503, 504.
  • Keep-alive upstream connectionsproxy_http_version 1.1 + Connection: "" for connection reuse.
  • Tuned for high concurrencyepoll, multi_accept, reuseport, keepalive_requests 10000.
  • Health endpointGET /health returns {"status":"ok","service":"proxy-gateway"} without hitting any upstream.
  • Small image — Alpine base keeps the image footprint minimal.
  • Zero config needed — works out of the box with the docker-compose.proxy.yml compose file.

Quick start

Use the docker-compose.proxy.yml file from the ZinTrust repository. The gateway is declared as the proxy-gateway service and is exposed on port 8800.

# Pull the compose file
curl -O https://raw.githubusercontent.com/ZinTrust/zintrust/master/docker-compose.proxy.yml

# Create a minimal env file
cat > .env.proxy <<'EOF'
APP_KEY=change-me-to-a-long-random-string
DOCKER_DB_HOST=host.docker.internal
DOCKER_REDIS_HOST=host.docker.internal
DB_DATABASE=zintrust
DB_USERNAME=root
DB_PASSWORD=secret
EOF

# Start the stack
docker compose -f docker-compose.proxy.yml --env-file .env.proxy up -d

Once running, verify the gateway:

curl http://localhost:8800/health
# {"status":"ok","service":"proxy-gateway"}

# Reach a specific proxy through the gateway
curl http://localhost:8800/mysql/health
curl http://localhost:8800/postgres/health
curl http://localhost:8800/redis/health

Environment variables

The gateway itself uses no application-level env vars. The following compose-level variables control how it is launched:

VariableDefaultDescription
PROXY_GATEWAY_IMAGEzintrust/zintrust-proxy-gateway:latestOverride the image tag
PROXY_GATEWAY_PORT8800Host port mapped to the gateway's 8080
PROXY_PULL_POLICYif_not_presentDocker pull policy
PROXY_GATEWAY_HEALTHCHECK_DISABLEfalseDisable Docker health check

Image tags

TagNotes
latestLatest stable release
x.y.zPinned release (recommended for production)

Publishing (maintainers)

Use the ZinTrust CLI to push updated images to Docker Hub:

# Push both images
zin cp publish-images --tag 1.2.0

# Push only the gateway image
zin cp publish-images --tag 1.2.0 --only gateway

Tag summary

Content type

Image

Digest

sha256:b0fa6dc84

Size

20 MB

Last updated

4 months ago

docker pull zintrust/zintrust-proxy-gateway:sha-6e8f833