Nginx解决上传文件大小问题

22149#0: *2723086 client intended to send too large body: 1598963 bytes, client: 222.89.182.102, server: wenda.feishuceshi.com, request: "POST /tool/test HTTP/1.1", host: "wenda.feishuceshi.com", referrer: "http://wenda.feishuceshi.com/tool/test"

原文做错是413 Request Entity 错误提示

就是个普通的上传接口用Nginx做Server的转发,出现这类错误此错误是上传文件超过了Nginx默认上传文件的大小

Nginx默认上传字节为1mB

    server {
        listen       80; //端口
        server_name  wenda.feishuceshi.com; //name
        client_max_body_size 100m;   //上传配置大小

		location / {
          root  /www/wwwroot/wenda.feishuceshi.com/dist;  //前端存放路径dist是Vue打包后的文件
			try_files $uri $uri/ /index.html;  
            index  index.html index.htm;   //首页为index.html,index,index.htm
        }

修改完之后重启Nginx配置就可以了

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值