worker_processes  1;
error_log  C:/tgstorage/tgstorage_app/logs/error.log;
pid        C:/tgstorage/tgstorage_app/logs/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       C:/tgstorage/tgstorage_app/mime.types;
    default_type  application/octet-stream;
    client_max_body_size 5000M;
    server {
        listen       80 default_server;
        server_name  db.api.draxon.asia localhost;
        
        # Increase timeouts for large files
        proxy_read_timeout 1200s;
        proxy_send_timeout 1200s;
        client_max_body_size 5000M;

        location / {
            proxy_pass http://127.0.0.1:8082;
            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;
            
            # Disable buffering for streaming
            proxy_buffering off;
            proxy_request_buffering off;
        }
    }
}
