Nginx 片段(示意)
Nginx 片段(示意)
location /v1/ {
if ($request_method = OPTIONS) { return 204; }
add_header Access-Control-Allow-Origin <前端域名> always;
add_header Access-Control-Allow-Headers "Authorization, Content-Type" always;
proxy_pass http://llm;
}流式在浏览器侧还要处理 fetch 流读取与断线重连:实现细节按前端框架文档处理。