mirror of
https://github.com/hanzoai/erp.git
synced 2026-09-30 21:46:27 +00:00
2.1 KiB
2.1 KiB
ERPNext Routing Architecture
Overview
All traffic routes through a single domain (e.g., erp.hanzo.ai). No additional hostnames or subdomains are required.
Traffic Flow
Internet
↓
Traefik (SSL termination)
↓
Frontend Service (nginx on port 8080)
├── /socket.io/* → WebSocket Service (port 9000)
├── /assets/* → Static Files (served directly)
└── /* → Backend Service (port 8000)
Service Communication
All services communicate internally via the hanzo-network:
- Frontend → Backend:
backend:8000 - Frontend → WebSocket:
websocket:9000 - Backend → Database:
db:3306 - Backend → Redis Cache:
redis-cache:6379 - Backend → Redis Queue:
redis-queue:6379 - Workers → Redis Queue:
redis-queue:6379
Exposed Services
Only the Frontend service is exposed to the internet via Traefik. All other services are internal only.
Key Features
WebSocket Support
- Proper upgrade headers configured
- CSP allows
wss://connections - nginx handles WebSocket proxy
Security
- All internal services isolated
- CSP headers prevent XSS
- HTTPS enforced via redirect
- X-Frame-Options prevents clickjacking
Headers
X-Forwarded-Proto: Ensures backend knows it's HTTPSX-Forwarded-Host: Preserves original hostX-Frappe-Site-Name: Routes to correct ERPNext site
No Additional Configuration Needed
- ✅ Single domain handles everything
- ✅ WebSocket support built-in
- ✅ All routing handled by nginx
- ✅ Traefik labels properly configured
- ✅ CSP allows all necessary connections
Troubleshooting
If WebSocket connections fail:
- Check browser console for CSP violations
- Ensure
wss://your-domainis in CSP connect-src - Verify nginx socket.io location block
- Check that websocket service is running
If backend connections fail:
- Verify all services are on same network
- Check service names match in environment variables
- Ensure configurator completed successfully
- Review nginx proxy_pass configuration