# chat.lan - HTTPS reverse proxy to LLeMbas (127.0.0.1:8080). # Deployed to /etc/nginx/conf.d/chat.lan.conf. Self-signed cert (chat.lan). # # Mirrors the comfy.lan and llama.lan vhosts on this box. server { listen 80; listen [::]:80; server_name chat.lan; return 301 https://$host$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; http2 on; server_name chat.lan; ssl_certificate /etc/nginx/ssl/chat.lan.crt; ssl_certificate_key /etc/nginx/ssl/chat.lan.key; ssl_protocols TLSv1.2 TLSv1.3; # File uploads land here once that feature exists; 0 = no limit. client_max_body_size 0; location / { proxy_pass http://127.0.0.1:8080; proxy_http_version 1.1; 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; # Streamed replies are server-sent events. Every one of these matters: # with buffering on, nginx holds the whole reply and delivers it in one # lump at the end, which looks exactly like streaming being broken. proxy_buffering off; proxy_request_buffering off; proxy_cache off; # SSE is plain HTTP/1.1 chunked, so the connection header must not be # the websocket upgrade dance -- it must simply stay open. proxy_set_header Connection ""; # A model can think for minutes before the first token. The default # 60s read timeout would cut long generations off mid-sentence. proxy_read_timeout 3600s; proxy_send_timeout 3600s; } # Static assets are immutable per release and never need revalidating. location /static/ { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; expires 1h; add_header Cache-Control "public"; } }