Reverse Proxy Mode¶
Overview¶
Reverse proxy mode is a configuration option that optimizes TradeServer Enterprise for deployment behind reverse proxy servers like nginx, Apache, Caddy, or HAProxy. This is the recommended configuration for production deployments with SSL/TLS support.
What it does¶
When REVERSE_PROXY_MODE is set to true:
- Disables built-in firewall checks - Security is delegated to the reverse proxy layer
- Frontend auto-detects connection URLs - Uses the browser's window.location to determine API endpoints
- Ignores EXTERNAL_* settings - Settings like EXTERNAL_SERVER_HOST and EXTERNAL_SERVER_PORT are not used
- Server binds to localhost only - Binds to 127.0.0.1 for security, preventing direct external access
Configuration¶
Direct Access (No Reverse Proxy)¶
For direct access without a reverse proxy, use the following configuration:
REVERSE_PROXY_MODE = false
SERVER_HOST = 127.0.0.1
SERVER_PORT = 8080
EXTERNAL_SERVER_HOST = your.public.ip
EXTERNAL_SERVER_PORT = 8090
Reverse Proxy with SSL¶
For reverse proxy deployments with SSL (nginx, Apache, HAProxy, etc.):
REVERSE_PROXY_MODE = true
SERVER_HOST = 127.0.0.1
SERVER_PORT = 8080
# EXTERNAL_* settings are automatically ignored
How it works¶
When reverse proxy mode is enabled, the frontend will automatically connect to:
- REST API:
https://yourdomain.com/(derived from browser URL) - WebSocket:
wss://yourdomain.com/ws(derived from browser URL)
The application automatically detects the protocol (http/https) and domain from the browser's current location, eliminating the need for manual EXTERNAL_* configuration.
Benefits¶
- Simplified configuration - No need to manage EXTERNAL_* settings
- Automatic SSL detection - Frontend adapts to https automatically
- Enhanced security - Built-in firewall disabled as security is handled by reverse proxy
- Production-ready - Designed for professional deployments with proper SSL/TLS
Security Note¶
Warning
When reverse proxy mode is enabled, the built-in firewall is disabled. Ensure your reverse proxy is properly configured to handle security, rate limiting, and access control.
For detailed reverse proxy setup instructions, see Linux VPS Hosting.