Reverse Proxy & HTTPS
Nyravio’s application server handles HTTP on port 8080. For production deployments, place a reverse proxy in front to provide HTTPS termination, compression, and security headers.
General requirements
Section titled “General requirements”Any reverse proxy that supports HTTP upstream, TLS termination, and WebSocket/SSE passthrough will work. Nyravio uses Server-Sent Events (SSE) for streaming — your proxy must support long-lived HTTP connections.
Key proxy configuration requirements:
- TLS termination with valid certificates
- HTTP/1.1 upstream to
http://nyravio:8080 - SSE support — do not buffer responses for SSE endpoints
- Timeouts — set read timeout ≥ 300s for streaming endpoints
- Headers — forward
Host,X-Real-IP,X-Forwarded-For,X-Forwarded-Proto
server { listen 443 ssl http2; server_name nyravio.example.com;
ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem;
location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;
# SSE support — disable buffering proxy_buffering off; proxy_cache off; proxy_read_timeout 300s; }}nyravio.example.com { reverse_proxy 127.0.0.1:8080}Caddy automatically provisions TLS certificates via Let’s Encrypt.
Traefik
Section titled “Traefik”Using Docker labels with Traefik v2/v3:
services: nyravio: labels: - "traefik.enable=true" - "traefik.http.routers.nyravio.rule=Host(`nyravio.example.com`)" - "traefik.http.routers.nyravio.entrypoints=websecure" - "traefik.http.routers.nyravio.tls.certresolver=letsencrypt" - "traefik.http.services.nyravio.loadbalancer.server.port=8080" networks: - traefik
networks: traefik: external: trueAdjust entrypoints, certresolver, and network name to match your Traefik configuration.
Security headers
Section titled “Security headers”When using a reverse proxy, add security headers at the proxy level:
Strict-Transport-Security: max-age=63072000; includeSubDomains; preloadX-Content-Type-Options: nosniffX-Frame-Options: DENYReferrer-Policy: strict-origin-when-cross-originPermissions-Policy: camera=(), microphone=(), geolocation=()Verifying HTTPS
Section titled “Verifying HTTPS”After configuring your reverse proxy:
# Check TLScurl -I https://nyravio.example.com/health/ready
# Verify security headerscurl -sI https://nyravio.example.com | grep -iE '(strict|x-content|x-frame|referrer|permissions)'Common issues
Section titled “Common issues”SSE streaming not working
Section titled “SSE streaming not working”Ensure your proxy does not buffer responses. For Nginx, set proxy_buffering off on the relevant location block. For cloud load balancers, check if response buffering can be disabled.
Timeouts on long conversations
Section titled “Timeouts on long conversations”Increase the proxy read timeout. AI model responses can take 30 seconds or more. Set the proxy read timeout to at least 300 seconds.
Mixed content warnings
Section titled “Mixed content warnings”Ensure X-Forwarded-Proto: https is forwarded to the application. The application uses this header to generate correct URLs.