Langchain-Chatchat
Langchain-Chatchat copied to clipboard
估计是你nginx或者服务器的限制,streanlit是200mb的
估计是你nginx或者服务器的限制,streanlit是200mb的
Originally posted by @zRzRzRzRzRzRzR in https://github.com/chatchat-space/Langchain-Chatchat/issues/3307#issuecomment-1994282861
嗨,@litongyun233!我们又见面了,很高兴再次看到你的消息。我正在查看您提出的问题,很快会给您一个完整的回答。
上传大于2MB的文件出现报错:AxiosError: Request failed with status code 413 看到说可能是nginx或者服务器的限制,streamlit是200mb的,请问应该如何排查是否是Nginx或者服务器的限制呢?@dosu-bot
Based on the error message you're receiving, it does seem like the issue could be related to a limitation in Nginx or the server. The error code 413 typically indicates that the request entity is too large. This can occur when the size of the request body exceeds the limit defined by the client_max_body_size directive in the Nginx configuration.
To investigate this, you can check the Nginx configuration file. This file is usually located at /etc/nginx/nginx.conf or within the server block of your site's configuration file in /etc/nginx/sites-available/. Look for the client_max_body_size directive. If it's set to a value less than the size of the file you're trying to upload, you've likely found the cause of the issue. You can adjust this setting to a value that accommodates your needs, such as client_max_body_size 10M; for a 10MB limit. After making changes, remember to reload or restart Nginx for the changes to take effect.
As for the server configuration, based on the provided context, there doesn't seem to be an explicit limitation set on the file size for uploads within the FastAPI application itself. FastAPI and underlying ASGI servers (like Uvicorn or Hypercorn) do not impose a hard limit on request body sizes by default. Therefore, it's unlikely that the limitation is coming from the FastAPI application based on the provided code.
However, if you're using any other reverse proxies or load balancers in front of Nginx, you would need to check their configurations as well for similar request body size limitations.
Unfortunately, I wasn't able to find specific information within the Langchain-Chatchat repository regarding the use of Nginx or any other reverse proxy or load balancer, or any custom middleware or configuration that could be limiting the file upload size. If you could provide more details about your setup, it would be easier to pinpoint the exact cause of the issue.
Sources
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
你可以在本地试试 localhost