5. Deploy with TLS
5.1. Configure a Reverse Proxy or Kubernetes Ingress Controller
To support HTTPS connections, STIG Manager components should be situated behind a reverse proxy or in a Kubernetes cluster. Configure the reverse proxy (such as nginx) or the Kubernetes Ingress Controller in accordance with publisher documentation, local security requirements, and Keycloak documentation. In either case, you will have to set Keycloak environment variable PROXY_ADDRESS_FORWARDING=true and make sure appropriate headers are forwarded.
5.2. STIG Manager with nginx for TLS and CAC Authentication
The STIG Manager OSS team provides a repository on GitHub with a sample nginx deployment, with a configuration file that may be useful to those setting up a Production deployment:
https://github.com/NUWCDIVNPT/stigman-orchestration
6. Proxy Configuration for Streaming and SSE Endpoints
Important
STIG Manager uses streaming responses and Server-Sent Events (SSE) for real-time operations. These require specific proxy configuration to function properly.
6.1. Proxy Requirements
For proper operation of streaming and SSE endpoints, your proxy must:
Disable response buffering for streaming endpoints
Pass through streaming headers without modification
Maintain persistent connections for SSE endpoints
The application automatically sets the x-accel-buffering: no header which nginx honors by default to disable buffering. Other proxies may require explicit configuration.
Warning
If your proxy is configured to:
Override or ignore response headers
Force buffering on all responses
Have aggressive timeout settings for long-lived connections
You MUST adjust your proxy configuration to exempt the endpoints listed below.
6.2. Essential Streaming Endpoints
The following endpoints require unbuffered, real-time response streaming:
Streaming Responses (NDJSON):
POST /collections/{collectionId}/export-to/{dstCollectionId}
Content-Type:
application/x-ndjsonOperation: Collection export with progress updates
opId:
exportToCollection
POST /collections/{collectionId}/clone
Content-Type:
application/x-ndjsonOperation: Collection cloning with progress updates
opId:
cloneCollection
Server-Sent Events (SSE):
GET /op/state/sse
Content-Type:
text/event-streamOperation: Real-time operation state updates
opId:
streamStateSse
6.3. Proxy-Specific Configuration Examples
While specific configuration varies by proxy, here are the key settings to verify:
- nginx:
Honors
x-accel-buffering: noheader automatically (no configuration needed)Ensure
proxy_bufferingis not forced toongloballyConsider setting
proxy_read_timeoutappropriately for SSE connections
- Apache:
Does NOT recognize
x-accel-bufferingheaderAdd
flushpackets=onto ProxyPass directive for streaming endpointsConsider
ProxyIOBufferSizeandProxyReceiveBufferSizesettingsExample:
ProxyPass /op/state/sse http://backend:3001/op/state/sse flushpackets=on
- HAProxy:
Typically works without modification
Verify
timeout serverandtimeout clientfor long connections
- Other Proxies:
Consult documentation for disabling response buffering
Look for settings related to “chunked transfer encoding” or “streaming responses”
6.4. Verifying Proper Configuration
Test SSE Endpoint:
After deployment, test the SSE endpoint to verify proper streaming:
curl -N http://<api-url>/op/state/sse
Or open in a browser:
http://<api-url>/op/state/sse
- Expected behavior:
Immediate initial response (within 1-2 seconds)
Periodic keepalive events every 30 seconds
No long delay before first response
- If issues occur:
Long delay before any response → Proxy is buffering
Connection drops after timeout → Timeout settings too aggressive
No events received → Headers being stripped or modified
6.5. Troubleshooting Option
- If you experience persistent buffering issues that cannot be resolved through proxy configuration, STIG Manager provides an environment variable to temporarily disable SSE functionality:
STIGMAN_CLIENT_STATE_EVENTS=false
This disables the web client’s SSE listening for API state events. This should only be used temporarily while resolving proxy buffering issues, as it disables real-time operation monitoring.
6.6. Future Considerations
Note
Future STIG Manager features will utilize WebSocket connections. When implementing, ensure your proxy supports:
HTTP connection upgrade to WebSocket protocol
Long-lived WebSocket connections
Appropriate timeout configurations for persistent connections