upstream opensora_api {
    server 127.0.0.1:8000;
    keepalive 32;
}

server {
    listen 80;
    server_name _;

    client_max_body_size 500M;

    location /health {
        proxy_pass http://opensora_api;
        proxy_set_header Host $host;
    }

    location /v1/ {
        limit_req zone=opensora_limit burst=10 nodelay;

        proxy_pass http://opensora_api;
        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_read_timeout    3600;
        proxy_send_timeout    3600;
        proxy_connect_timeout 10;
    }
}
