Reverse Proxy Setup
To prepare your Cortensor Router Node for production use and support future scaling, it is recommended to set up an Nginx reverse proxy in front of your API service. This setup enables secure HTTPS access, controlled endpoint exposure, and load distribution across multiple router nodes.
Why Use a Reverse Proxy?
Production-Ready Architecture: Adds SSL, security headers, CORS, and configurable access control.
Scalability: Makes it easier to load balance requests across multiple router nodes.
Security: Hides internal ports and enables HTTPS via Let's Encrypt.
Routing Control: Restricts access to specific endpoints and protects internal services.
Setup Guide
1. Prerequisites
A running Cortensor Router Node (
cortensord ~/.cortensor/.env routerv1
)Public domain pointing to your VPS (e.g.,
router.example.com
)Root access (
sudo
) on your node serverPorts
80
and443
open on your firewall
2. Installation Script
Run the official Cortensor Nginx installer on your Router Node host:
This will:
Install Nginx and Certbot
Prompt you to enter your domain
Generate and apply a complete reverse proxy config for your Router Node
Optionally install HTTPS using Let’s Encrypt
3. API Server Configuration
Ensure your Router Node API is running on port 5010
(default):
Update your .env
:
4. SSL Setup (Optional but Recommended)
If DNS is properly configured, the installer will prompt you to secure your router domain via Certbot. You can always run this manually later:
5. Sample Architecture Diagram
Available Endpoints (by default)
The reverse proxy allows access only to these:
/api/v1/info
/api/v1/status
/api/v1/miners
/api/v1/sessions
/api/v1/completions
/api/v1/tasks
/api/v1/ping
All other routes return 404
.
CORS Configuration
The template includes both:
Restricted CORS: Allow specific trusted origins
Permissive CORS: (commented by default) allows all origins
Update CORS settings in:
Maintenance Commands
Notes
This setup is designed for private router nodes. Load balancing and auto-scaling support will be introduced in future versions.
Make sure the API port (5010) is not exposed publicly when reverse proxy is enabled.
What’s Next?
Support for multi-router failover
Integration with Cortensor Dashboard & Metrics
Dynamic scaling across multiple router nodes
Last updated