server {
    listen 18183 ssl;
    server_name company.citupro.com;

    # Replace these paths with your real certificate files.
    ssl_certificate /etc/nginx/ssl/company.citupro.com.crt;
    ssl_certificate_key /etc/nginx/ssl/company.citupro.com.key;

    client_max_body_size 100m;

    # DDL/LLM 解析可能较慢，单独放宽超时（避免 504 Gateway Timeout）
    location /api/bd/ddlparse {
        proxy_pass http://127.0.0.1:5500;
        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;
        proxy_connect_timeout 60s;
        proxy_send_timeout 300s;
        proxy_read_timeout 300s;
    }

    location / {
        proxy_pass http://127.0.0.1:5500;
        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;
        proxy_connect_timeout 60s;
        proxy_send_timeout 180s;
        proxy_read_timeout 180s;
    }
}
