# 查价中台 — Nginx 站点配置（HTTP，用于首次部署或申请证书前）
# 安装：bash deploy/install.sh --nginx-http
# 或手动：
#   sudo cp deploy/nginx/chajia.http.conf /etc/nginx/sites-available/chajia
#   sudo ln -sf /etc/nginx/sites-available/chajia /etc/nginx/sites-enabled/chajia
#   sudo nginx -t && sudo systemctl reload nginx

upstream chajia_next {
    server 127.0.0.1:3000;
    keepalive 32;
}

server {
    listen 80;
    listen [::]:80;
    # 【请修改】改为你的域名，或服务器 IP
    server_name quote.example.com;

    client_max_body_size 2m;

    # 地址联想接口最长 300s，询价轮询由客户端完成
    proxy_connect_timeout 60s;
    proxy_send_timeout 360s;
    proxy_read_timeout 360s;

    location / {
        proxy_pass http://chajia_next;
        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_set_header Connection "";
    }
}
