I am making this request with the 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().send(data, function(error, body) {
if(error) console.log(error)
console.log(body);
});
and am getting this error:
{ [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 }
How do I fix this? Is it because the attachment is too big?
This is running on a Digital Ocean server, and I never set up nginx. This is simply an express.js app.