Proxy Setup for Multi-Instance Rigs: Using Nginx
Table of Contents
Power users often find that a single CaptureGem instance isn’t enough. Whether you’re separating sites to manage different storage pools or running different “rig profiles,” running multiple instances on one machine is a pro-tier workflow.
The challenge is remote access: how do you access the Monitor API for instance #1 and instance #2 without remembering dozens of port numbers? The solution is Nginx Reverse Proxy.
1. Why use a Reverse Proxy?
By default, each CaptureGem instance uses a specific port (e.g., 8080, 8081). A reverse proxy allows you to access them via clean URLs:
http://rig.local/monitor1-> Instance #1http://rig.local/monitor2-> Instance #2
2. Basic Nginx Configuration
Install Nginx on your recording machine. Then, create a configuration file (usually in /etc/nginx/sites-available/capturegem):
server {
listen 80;
server_name rig.local;
# Instance 1
location /monitor1/ {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# Instance 2
location /monitor2/ {
proxy_pass http://127.0.0.1:8081/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
3. Handling WebSockets
CaptureGem’s Monitor uses WebSockets for real-time status updates. Ensure your Nginx config supports them by adding these lines to your location blocks:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
4. Running Multi-Instances on Windows
If you are on Windows, you can achieve the same using Nginx for Windows or by using subdomains with a tool like Tailscale or Cloudflare Tunnel.
- Launch the first instance normally.
- Launch the second instance with the
--port 8081and--config-dir "C:\CG-Instance2"flags. - Point Nginx to the respective ports.
5. Benefits of the Proxy Approach
- Consolidated Access: Access all your rigs from one bookmark.
- SSL Support: Easily add HTTPS to your local Monitor using Nginx and
mkcert. - Security: Add
Basic Authat the Nginx level for an extra layer of protection if exposing the monitor to your local network.
By moving to a multi-instance, proxy-managed setup, you gain the ultimate flexibility in how you capture and archive your high-fidelity streams.
Loading comments...