lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
39.94k stars 9.09k forks source link

[Question] 使用Nginx做代理自定义域名后,无法实现流式回答 #754

Closed syusama closed 8 months ago

syusama commented 8 months ago

🧐 问题描述 | Proposed Solution

部署在服务器上后,如果使用ip:port访问,可以正常流式回答(打字机效果),但是配置NGINX自定义域名之后,就没有打字机效果了,会等待很长一段时间然后返回回答

📝 补充信息 | Additional Information

NGINX配置如下: server { server_name baize2.xxxxx.com; location / { client_max_body_size 64m; proxy_http_version 1.1; proxy_pass http://localhost:3210; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header Accept-Encoding gzip; proxy_read_timeout 300s; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host:$server_port; proxy_set_header X-NginX-Proxy true; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_max_temp_file_size 0; proxy_redirect off; proxy_set_header X-Real-PORT $remote_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/baize2.scdipt.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/baize2.scdipt.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
if ($host = baize2.xxxxxx.com) {
    return 301 https://$host$request_uri;
} # managed by Certbot

    listen 80;
    server_name baize2.scdipt.com;
return 404; # managed by Certbot

}}

lobehubbot commented 8 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


🧐 Problem Description | Proposed Solution

After deployed on the server, if you use ip:port to access, you can stream the answer normally (typewriter effect). However, after configuring the NGINX custom domain name, there is no typewriter effect, and the answer will be returned after waiting for a long time.

📝 Additional Information |

NGINX configuration is as follows: server { server_namebaize2.xxxxx.com; location/{ client_max_body_size 64m; proxy_http_version 1.1; proxy_pass http://localhost:3210; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header Accept-Encoding gzip; proxy_read_timeout 300s; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host:$server_port; proxy_set_header X-NginX-Proxy true; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_max_temp_file_size 0; proxy_redirect off; proxy_set_header X-Real-PORT $remote_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/baize2.scdipt.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/baize2.scdipt.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server { if ($host = baize2.xxxxxx.com) { return 301 https://$host$request_uri; } # managed by Certbot

listen 80; server_namebaize2.scdipt.com; return 404; # managed by Certbot

}}

lobehubbot commented 8 months ago

👀 @syusama

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

arvinxx commented 8 months ago

试试 https://github.com/lobehub/lobe-chat/discussions/531

syusama commented 8 months ago

试试 #531

感谢大佬,可以了!!!!

lobehubbot commented 8 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Try #531

Thanks man, it’s ok! ! ! !

lobehubbot commented 8 months ago

✅ @syusama

This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。