Overview
Running Borg UI behind a reverse proxy enables:- SSL/TLS encryption (HTTPS)
- Custom domains (e.g.,
backups.yourdomain.com) - Subfolder deployment (e.g.,
yourdomain.com/borg) - Additional security features
- Integration with existing infrastructure
Nginx
Root Path Configuration
For serving Borg UI at the root of a domain (backups.yourdomain.com):
Subfolder Configuration
For serving Borg UI in a subfolder (yourdomain.com/borg):
Configure BASE_PATH in Borg UI
Set the Docker Compose:Unraid:
Add environment variable:
BASE_PATH environment variable:Docker:Configure Nginx
Note the trailing slash in
proxy_pass http://localhost:8081/; - this is required for subfolder setups.Nginx Proxy Manager
Popular with Unraid users and home lab setups:Subfolder with NPM
For subfolder deployment (yourdomain.com/borg):
- Set
BASE_PATH=/borgin Borg UI container (see above) - In NPM Proxy Host:
- In Advanced tab:
Traefik
Root Path Configuration
Using Docker labels for Traefik v2/v3:docker-compose.yml
Subfolder Configuration
Traefik File Configuration
Alternatively, usingtraefik.yml or dynamic configuration:
traefik-dynamic.yml
Caddy
Root Path Configuration
Caddyfile
Subfolder Configuration
Caddyfile
Apache
Root Path Configuration
Subfolder Configuration
Configuration Summary
BASE_PATH Environment Variable
| Deployment | Example | BASE_PATH Value |
|---|---|---|
| Root domain | backups.domain.com | Not needed (or /) |
| Subfolder | domain.com/borg | /borg |
| Subfolder | domain.com/backup | /backup |
Common Proxy Settings
Essential headers for all reverse proxy configurations:Testing
Verify Configuration
Test WebSocket connection
Open browser developer tools (F12) → Network tab → WS filter. Navigate to Borg UI and start a backup. You should see WebSocket connections for real-time updates.
Troubleshooting
502 Bad Gateway
Cause: Reverse proxy can’t reach Borg UI container. Solutions:-
Verify Borg UI is running:
-
Check if port 8081 is accessible:
- Verify network connectivity between proxy and container
- Check proxy logs for connection errors
404 Not Found (Subfolder Setup)
Cause: BASE_PATH not configured correctly. Solutions:-
Verify
BASE_PATHis set in container: -
Ensure BASE_PATH starts with
/and has no trailing slash -
Rebuild container after setting BASE_PATH:
- Check proxy configuration matches BASE_PATH value
Static Assets Not Loading
Cause: Incorrect proxy_pass configuration or missing BASE_PATH. Solutions:-
For subfolder setups, ensure trailing slash in proxy_pass:
- Verify BASE_PATH is set and container rebuilt
- Check browser console for 404 errors on assets
WebSocket Connection Failed
Cause: Missing WebSocket proxy headers. Solutions:- Add WebSocket headers (see examples above)
-
Verify HTTP version is 1.1:
- Check firewall allows WebSocket connections
Operation Timeouts
Cause: Proxy timeout too short for long-running operations. Solutions:- Increase proxy timeouts to 600s (see examples above)
-
Increase Borg operation timeouts in container:
- Check both proxy and container logs for timeout errors
Security Best Practices
Use Strong SSL/TLS Configuration
Use Strong SSL/TLS Configuration
- Use TLS 1.2 or higher
- Disable weak ciphers
- Enable HSTS
- Use valid SSL certificates (Let’s Encrypt recommended)
- Enable HTTP/2 for better performance
Restrict Access
Restrict Access
- Use firewall rules to limit access
- Consider IP whitelisting for admin interface
- Enable fail2ban for brute force protection
- Use strong passwords
- Consider adding HTTP basic auth at proxy level
Security Headers
Security Headers
Always include:
Strict-Transport-SecurityX-Content-Type-OptionsX-Frame-OptionsX-XSS-Protection
Rate Limiting
Rate Limiting
Implement rate limiting at reverse proxy level:Nginx:Traefik:
Next Steps
Docker
Simple deployment with docker run
Docker Compose
Recommended production setup