代码之家  ›  专栏  ›  技术社区  ›  Faraz Ahmed

Docker Rocket chat Rest api上载文件错误413实体太大

  •  0
  • Faraz Ahmed  · 技术社区  · 6 年前

    413 Request Entity Too Large ,但当我从网站上传文件时,它上传了任何大小的fie。

    413请求实体太大 .

    https://rocket.chat.url/api/v1/rooms.upload/RoomId

    内容-类型:application/x-www-form-urlencoded

    X认证-令牌:用户令牌

    用户Id:X-Id

    表单数据:

    文件-选定的文件

    <html>
    <head><title>413 Request Entity Too Large</title></head>
    <body bgcolor="white">
    <center><h1>413 Request Entity Too Large</h1></center>
    <hr><center>nginx/1.10.3 (Ubuntu)</center>
    </body>
    </html>
    

    当文件成功插入时,将显示以下内容。

    {
       "success": true
    }
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Community Mohan Dere    6 年前

    在检查了许多场景并搜索了许多URL之后,我从中得到了解决方案 this .

    rocket chat docker 我加了一行 nginx 配置文件。

    解决方案:

    1. 登录ubuntu服务器
    2. sudo nano /etc/nginx/nginx.conf 然后按回车键
    3. 添加或更新 client_max_body_size 在里面
    http {
    
        client_max_body_size 8M; //used your exceeded limit instead of 8M
    
        //other lines...
    
    }
    
    1. nginx公司 按口令 service nginx restart