麻烦大家帮我解决下这个问题
发布于 3 个月前 作者 yanglinnie 344 次浏览 来自 问答

文章过长的时候 提示这个错误 413 错误 nginx的最大长度也调整了 还是不行 Error: request entity too large
   at readStream (/alidata/www/niefengjun/boke6/node_modules /body-parser/node_modules/raw-body/index.js:196:17)
   at getRawBody (/alidata/www/niefengjun /boke6/node_modules/body-parser/node_modules/raw-body/index.js:106:12)
   at read (/alidata /www/niefengjun/boke6/node_modules/body-parser/lib/read.js:68:3)
   at urlencodedParser (/alidata/www/niefengjun/boke6/node_modules/body-parser/lib/types/urlencoded.js:109:5)
  &nbsp ;at Layer.handle [as handle_request] (/alidata/www/niefengjun/boke6/node_modules/express/lib/router/layer .js:95:5)
   at trim_prefix (/alidata/www/niefengjun/boke6/node_modules/express/lib/router /index.js:312:13)
   at /alidata/www/niefengjun/boke6/node_modules/express/lib/router/index .js:280:7
   at Function.process_params (/alidata/www/niefengjun/boke6/node_modules/express /lib/router/index.js:330:12)
   at next (/alidata/www/niefengjun/boke6/node_modules/express /lib/router/index.js:271:10)
   at expressInit (/alidata/www/niefengjun/boke6/node_modules /express/lib/middleware/init.js:33:5)

2 回复

你设备body parse的长度撒。可以配置的嘛

app.use(bodyParser.urlencoded({ extended: true,limit: ‘50mb’ })) //app.use(bodyParser.json()); app.use(express.static(path.join(__dirname, ‘public’))); app.set(‘views’, path.join(__dirname, ‘views’)); app.use(bodyParser.json({ “limit”:“80mb”})); 设置了 还是不行呢

回到顶部