Node.js Mailgun错误:413请求实体太大
我通过Mailgun API提出此请求:Node.js Mailgun错误:413请求实体太大,node.js,express,nginx,mailgun,http-status-code-413,Node.js,Express,Nginx,Mailgun,Http Status Code 413,我通过Mailgun API提出此请求: var filepath = path.join(__dirname, "/output/" + job.jobId + ".zip"); var data = { from: 'Name <name@url.com>', to: email, subject: 'Test', text: 'Test', attachment: filepath }; mailgun_client.messages
var filepath = path.join(__dirname, "/output/" + job.jobId + ".zip");
var data = {
from: 'Name <name@url.com>',
to: email,
subject: 'Test',
text: 'Test',
attachment: filepath
};
mailgun_client.messages().send(data, function(error, body) {
if(error) console.log(error)
console.log(body);
});
var filepath=path.join(uu dirname,“/output/”+job.jobId+“.zip”);
风险值数据={
发件人:'姓名',
致:电邮:,
主题:“测试”,
文本:“测试”,
附件:文件路径
};
mailgun_client.messages().send(数据、函数(错误、正文){
if(错误)console.log(错误)
控制台日志(主体);
});
我得到了这个错误:
{ [Error: <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.7.9</center>
</body>
</html>
] statusCode: 413 }
{[错误:
413请求实体太大
413请求实体太大
nginx/1.7.9
]状态代码:413}
我该如何解决这个问题?是因为附件太大吗
这是在数字海洋服务器上运行的,我从未设置过nginx。这只是一个express.js应用程序 很可能。“注意Mailgun支持最大25MB的邮件大小。”-就是这样。附件大小>25MB。