# Arb Pulse — nginx vhost (host-level), to sit alongside consumet/openclaw.
#
# Install:
#   sudo cp deploy/nginx/arbpulse.wayool.com.conf /etc/nginx/sites-available/arbpulse.wayool.com
#   sudo ln -s /etc/nginx/sites-available/arbpulse.wayool.com /etc/nginx/sites-enabled/
#   sudo nginx -t && sudo systemctl reload nginx
#   sudo certbot --nginx -d arbpulse.wayool.com   # issues cert + adds the 443 block + HTTP->HTTPS redirect
#
# certbot copies the location block into the TLS server it generates, so the
# SSE-friendly proxy settings below carry over to HTTPS.

server {
    listen 80;
    listen [::]:80;
    server_name arbpulse.wayool.com;

    # Proxy everything to the app container (loopback-published by docker compose).
    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;

        # SSE (/api/stream): stream in real time, never buffer, keep long-lived.
        proxy_buffering            off;
        proxy_cache                off;
        proxy_set_header           Connection "";
        proxy_read_timeout         3600s;
        proxy_send_timeout         3600s;
        chunked_transfer_encoding  off;
    }
}
