
Complete guide for deploying WSLProxy using Docker in various scenarios.
bashdocker pull bwalia/wslproxy:latest
bashdocker run -d \ --name wslproxy \ -p 80:80 \ -p 443:443 \ -p 8080:8080 \ bwalia/wslproxy:latest
| Image | Purpose | Tags |
|---|---|---|
bwalia/wslproxy | Full WSLProxy OpenResty application | latest, <commit-sha> |
bwalia/wslproxy-alternate | WSLProxy alternate build variant | latest, <commit-sha> |
bwalia/node-app | Node.js sample backend API | latest, <commit-sha> |
bwalia/s3-browser-app | S3 browser application | latest, <commit-sha> |
┌─────────────────────────────────────────────────────────┐ │ wslproxy Container │ ├─────────────────────────────────────────────────────────┤ │ │ │ OpenResty (Nginx with Lua) │ │ ├─ SSL/TLS Termination (auto-ssl) │ │ ├─ Lua API Gateway │ │ ├─ Reverse Proxy │ │ ├─ Prometheus Metrics │ │ ├─ Traffic Logging & Analytics │ │ └─ Admin Dashboard (React) │ │ │ │ Port 80 - HTTP │ │ Port 443 - HTTPS │ │ Port 8080 - Admin Dashboard & Metrics │ │ │ └─────────────────────────────────────────────────────────┘ ↓ ↓ ↓ Upstream Servers Configuration Redis Cache
Quick local development with hot-reload capabilities:
bashdocker-compose -f docker-compose-dev.yml up -d
See docker-compose-dev.yml below for details.
Features:
Single container production deployment:
bashdocker run -d \ --name wslproxy-prod \ --restart always \ -p 80:80 \ -p 443:443 \ -p 8080:8080 \ -e NGINX_CONFIG_DIR=/opt/nginx \ -v wslproxy-data:/opt/nginx/data \ -v wslproxy-certs:/etc/resty-auto-ssl \ bwalia/wslproxy:latest
With Redis backend:
bash# Start Redis docker run -d \ --name wslproxy-redis \ --restart always \ redis:alpine # Start WSLProxy with Redis docker run -d \ --name wslproxy-prod \ --restart always \ --link wslproxy-redis:redis \ -p 80:80 \ -p 443:443 \ -p 8080:8080 \ -e REDIS_HOST=redis \ -e REDIS_PORT=6379 \ -v wslproxy-data:/opt/nginx/data \ -v wslproxy-certs:/etc/resty-auto-ssl \ bwalia/wslproxy:latest
Using Helm chart (recommended):
bashhelm install wslproxy ./infra/helm-charts/wslproxy \ -n wslproxy \ --create-namespace \ -f values-prod.yaml
See infra/helm-charts/wslproxy/ for Helm configuration.
Using Docker Compose with shared volumes:
yamlversion: '3.8' services: wslproxy-1: image: bwalia/wslproxy:latest ports: - "80:80" - "443:443" - "8080:8080" volumes: - wslproxy-config:/opt/nginx - wslproxy-certs:/etc/resty-auto-ssl environment: REDIS_HOST: redis NGINX_CONFIG_DIR: /opt/nginx depends_on: - redis wslproxy-2: image: bwalia/wslproxy:latest ports: - "8080:80" - "8443:443" - "8081:8080" volumes: - wslproxy-config:/opt/nginx - wslproxy-certs:/etc/resty-auto-ssl environment: REDIS_HOST: redis NGINX_CONFIG_DIR: /opt/nginx depends_on: - redis redis: image: redis:alpine volumes: - redis-data:/data volumes: wslproxy-config: wslproxy-certs: redis-data:
| Variable | Default | Purpose |
|---|---|---|
NGINX_CONFIG_DIR | /opt/nginx | Configuration directory path |
REDIS_HOST | localhost | Redis server hostname |
REDIS_PORT | 6379 | Redis server port |
DNS_RESOLVER | 127.0.0.11 | DNS resolver for requests |
PRIMARY_DNS_RESOLVER | 8.8.8.8 | Primary DNS for ACME |
SECONDARY_DNS_RESOLVER | 8.8.4.4 | Secondary DNS for ACME |
SSL_STAGING | false | Use Let's Encrypt staging environment |
SSL_OCSP_STAPLING | true | Enable OCSP stapling |
bash# Data persistence -v /path/to/config:/opt/nginx/data # SSL certificates (auto-renewing) -v /path/to/certs:/etc/resty-auto-ssl # Configuration files -v /path/to/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf # Custom Lua scripts -v /path/to/api:/usr/local/openresty/nginx/html/api
The container requires a settings.json file in the data volume:
json{ "instance_id": "my-proxy", "instance_name": "My Proxy Instance", "env_profile": "prod", "redis_host": "redis", "storage_type": "disk", "env_vars": { "REDIS_HOST": "redis", "REDIS_PORT": 6379, "CONTROL_PLANE_API_URL": "https://example.com/api", "FRONT_URL": "https://example.com" }, "super_user": { "email": "admin@example.com", "password": "hashed_password", "username": "admin" } }
| Port | Protocol | Purpose |
|---|---|---|
| 80 | HTTP | Standard web traffic |
| 443 | HTTPS | Encrypted web traffic |
| 8080 | HTTP | Admin Dashboard & Prometheus metrics |
| 8500 | HTTP | Consul API (optional) |
bashdocker exec wslproxy curl -f http://localhost:8080/health || exit 1
bashdocker exec wslproxy openresty -t
bashcurl -s http://localhost:8080/api/health
bash# Real-time logs docker logs -f wslproxy # Last 100 lines docker logs --tail 100 wslproxy # With timestamps docker logs -f -t wslproxy
bashdocker exec wslproxy tail -f /usr/local/openresty/nginx/logs/error.log
bashdocker exec wslproxy tail -f /usr/local/openresty/nginx/logs/access.log
bashcurl http://localhost:8080/metrics
nginx_http_requests_total - Total HTTP requestsnginx_http_request_duration_seconds - Request latencynginx_http_request_size_bytes - Request sizenginx_http_response_size_bytes - Response sizenginx_http_errors_total - Total errors by status codebashdocker pull bwalia/wslproxy:latest
bash# Stop old container docker stop wslproxy # Remove old container (if needed) docker rm wslproxy # Start new container docker run -d \ --name wslproxy \ -p 80:80 \ -p 443:443 \ -p 8080:8080 \ -v wslproxy-data:/opt/nginx/data \ -v wslproxy-certs:/etc/resty-auto-ssl \ bwalia/wslproxy:latest
bash# 1. Start new container docker run -d --name wslproxy-new bwalia/wslproxy:latest # 2. Point load balancer to new container # 3. Wait for requests to drain from old container # 4. Stop old container docker stop wslproxy # 5. Rename new container docker rename wslproxy-new wslproxy
bash# Check logs docker logs wslproxy # Check if Nginx configuration is valid docker exec wslproxy openresty -t # Check port availability netstat -tuln | grep -E ':(80|443|8080)'
bash# Check memory usage docker stats wslproxy # Reduce worker processes # Modify nginx.conf: worker_processes auto; → worker_processes 2;
bash# Check certificate directory docker exec wslproxy ls -la /etc/resty-auto-ssl # View certificate details docker exec wslproxy openssl x509 -in /etc/resty-auto-ssl/certs/example.com.crt -text -noout
bash# Test DNS inside container docker exec wslproxy nslookup google.com # Check resolver configuration docker exec wslproxy cat /usr/local/openresty/nginx/conf/nginx.conf | grep resolver
Use specific image tags (not latest in production)
bashdocker run bwalia/wslproxy:abc123def456
Run as non-root (already configured in image)
bashdocker run --user nobody bwalia/wslproxy:latest
Use read-only filesystem where possible
bashdocker run --read-only --tmpfs /tmp bwalia/wslproxy:latest
Restrict capabilities
bashdocker run --cap-drop=ALL --cap-add=NET_BIND_SERVICE \ bwalia/wslproxy:latest
Use secrets for sensitive data
bashdocker run \ --secret db_password \ -e DB_PASSWORD_FILE=/run/secrets/db_password \ bwalia/wslproxy:latest
Regular updates
bashdocker pull bwalia/wslproxy:latest docker-compose up -d # Automatically uses latest
yamlversion: '3.8' services: wslproxy: build: context: . dockerfile: Dockerfile args: APP_ENV: dev ports: - "80:80" - "443:443" - "8080:8080" volumes: - ./api:/usr/local/openresty/nginx/html/api - ./html:/usr/local/openresty/nginx/html - ./openresty-admin/src:/usr/local/openresty/nginx/html/openresty-admin/src - ./data:/opt/nginx/data - wslproxy-certs:/etc/resty-auto-ssl environment: NGINX_CONFIG_DIR: /opt/nginx REDIS_HOST: redis REDIS_PORT: 6379 depends_on: - redis redis: image: redis:alpine ports: - "6379:6379" volumes: - redis-data:/data
yamlversion: '3.8' services: wslproxy: image: bwalia/wslproxy:latest restart: always ports: - "80:80" - "443:443" - "8080:8080" volumes: - wslproxy-data:/opt/nginx/data - wslproxy-certs:/etc/resty-auto-ssl environment: NGINX_CONFIG_DIR: /opt/nginx REDIS_HOST: redis REDIS_PORT: 6379 depends_on: - redis healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s redis: image: redis:alpine restart: always volumes: - redis-data:/data command: redis-server --appendonly yes volumes: wslproxy-data: wslproxy-certs: redis-data:
bashdocker build -t wslproxy:dev .
bashdocker build \ --build-arg APP_ENV=prod \ -t wslproxy:prod \ .
bashdocker buildx build \ --platform linux/amd64,linux/arm64 \ -t bwalia/wslproxy:latest \ --push \ .
Images are automatically built and pushed to Docker Hub on:
main branchSee .github/workflows/k3s-build-push-deploy.yaml for automation details.
bwalia/wslproxy:latest - Latest versionbwalia/wslproxy:<commit-sha> - Specific commitFor issues, bugs, or feature requests:
docker logs wslproxydocker exec wslproxy openresty -tSee LICENSE file for details.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务