有佬给个配置看看么,我越改越不对劲
2 个赞
你咋配的,有什么问题
2 个赞
有时候吐不出字,出现:糟糕!连接到xxx时出现问题。 之前是有时候发了消息没任何反应,必须新建个消息。
1 个赞
我能确定不是API那里出的问题
1 个赞
想吐字快一点能优化么
server {
listen 80;
listen 443 ssl;
listen [::]:80;
listen [::]:443 ssl;
http2 on;
server_name <>;
if ($scheme != "https") {
return 301 https://$server_name$request_uri;
}
access_log /etc/nginx/log/open-webui.log main;
proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;
location / {
proxy_pass http://127.0.0.1:3000/;
proxy_set_header Host $http_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 Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
}
location /v1 {
proxy_set_header Host api.openai.com;
proxy_pass https://api.openai.com/v1;
proxy_ssl_name api.openai.com;
proxy_ssl_server_name on;
proxy_pass_request_headers on;
proxy_http_version 1.1;
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# SSL certificates
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
# SSL settings
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
# Diffie-Hellman parameter for DHE ciphersuites
#ssl_dhparam /path/to/dhparam.pem;
# SSL protocols
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
# SSL ciphers
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256;
}
感谢佬,我试试
流式可以优化一下,比如
# 优化TCP发送
sendfile on;
tcp_nopush on;
tcp_nodelay on;
# 启用 gzip 压缩
gzip on;
gzip_types text/plain application/xml application/json;
gzip_min_length 1000;
gzip_proxied any;
还有些location里的
proxy_buffering off;
proxy_request_buffering off;
proxy_ignore_client_abort on;
proxy_buffer_size 4k;
proxy_buffers 4 4k;
proxy_busy_buffers_size 8k;
proxy_http_version 1.1;
proxy_set_header Connection "keep-alive";
1 个赞
谢了佬!
吐字速度还跟上游有很大关系,上游api要是慢的话,nginx怎么配都没用。另外api如果是用的newapi或者oneapi,可以用同一台机器上的内网地址。这样少了公网网络通讯应该延迟会低一些
改了N次,始终没vercel上的nextchat那么丝滑。
你的咋样,给我瞅瞅呗
用的内网,但是open webui吐字还是比nextchat要慢
1 个赞
要不要试试我的,我好像解决了这个问题了,定向优化
1 个赞
建议发我
准备搭建一个,学习一下