
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
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.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务