Skip to main content

Reverse Proxy

To make the StanagNetSim operator UI available over HTTPS, run a reverse proxy on the same Linux host. Bind the simulator to 127.0.0.1:8200 and point a DNS name such as sim.example.com at the proxy. Keep TCP port 8200 private and protect the entire operator hostname with authentication or private network access. The UI and API give operators control of the simulator. Linux listener setup

Forward every path on the operator hostname to the simulator, including /help/ and /api/. Preserve the public Host header because the app compares it with the browser's Origin on API writes and WebSocket handshakes. Enable WebSocket upgrades for live statistics, KLV, and preview signaling.

Caddy​

Add this site to your Caddyfile. Replace the hostname and generate the operator's password hash with caddy hash-password. Allow inbound TCP 80 and 443 to Caddy for automatic HTTPS and redirects. Caddy preserves the Host header and upgrades WebSockets by default. Caddy reverse proxy · Caddy automatic HTTPS

sim.example.com {
basic_auth {
operator REPLACE_WITH_PASSWORD_HASH
}
reverse_proxy 127.0.0.1:8200
}

Nginx​

Put the map and server blocks in Nginx's http context, for example in a site configuration file included from http. Replace the hostname and certificate paths. Create the password file with sudo htpasswd -c /etc/nginx/stanag-net-sim.htpasswd operator the first time, then ensure Nginx can read it. Allow inbound TCP 443. Check the configuration with sudo nginx -t before reloading. Nginx WebSocket proxying · Nginx basic authentication

map $http_upgrade $stanag_connection_upgrade {
default upgrade;
'' close;
}

server {
listen 443 ssl;
server_name sim.example.com;

ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/privkey.pem;

auth_basic "StanagNetSim";
auth_basic_user_file /etc/nginx/stanag-net-sim.htpasswd;

location / {
proxy_pass http://127.0.0.1:8200;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $stanag_connection_upgrade;
proxy_read_timeout 1h;
}
}

If operators upload replay files through Host media, set client_max_body_size in the location block to a limit that fits their uploads. Set proxy_request_buffering off there to stream uploads to the app. The app accepts multipart requests up to 4 GiB including framing and requires a writable media directory. Nginx body size limit · Nginx request buffering · Host media settings

WebRTC preview​

The HTTPS proxy carries preview signaling. Video travels through a separate WebRTC connection. For direct previews, enable Restrict UDP ports under Server settings → WebRTC and allow that UDP range through the host firewall and cloud security group. If NAT or firewalls prevent direct connections, configure a reachable TURN relay. UDP and SRT media endpoints also use their own configured ports. WebRTC settings

Optional MCP listener​

For remote MCP clients, use a dedicated HTTPS hostname that forwards every path to the configured MCP port, 127.0.0.1:8201 by default. Select HTTPS reverse proxy in Server settings → MCP and enter that hostname's HTTPS origin. Preserve Host and Authorization so the listener can serve OAuth and authenticate MCP requests. MCP reverse proxy setup