Skip to content

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.

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.

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: true

Adjust entrypoints, certresolver, and network name to match your Traefik configuration.

When using a reverse proxy, add security headers at the proxy level:

Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()

After configuring your reverse proxy:

Terminal window
# Check TLS
curl -I https://nyravio.example.com/health/ready
# Verify security headers
curl -sI https://nyravio.example.com | grep -iE '(strict|x-content|x-frame|referrer|permissions)'

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.

Increase the proxy read timeout. AI model responses can take 30 seconds or more. Set the proxy read timeout to at least 300 seconds.

Ensure X-Forwarded-Proto: https is forwarded to the application. The application uses this header to generate correct URLs.