12

I am trying to deploy a Node-based web service to elastic beanstalk but running into problems when posting too much data. The issue seems to be at the nginx layer, not the Node / express layer. The message I get is:

<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.6.2</center>
  </body>
</html>

Based on other answers on StackOverflow, I added a folder to the root of my project called .ebextensions and a file inside called nginx.config. The contents of this file are:

files:
    "/etc/nginx/conf.d/proxy.conf" :
        mode: "000755"
        owner: root
        group: root
        content: |
           client_max_body_size 50M;

I deployed this along with my node application and even restarted the app server. So far it seems to have no effect. Am I doing something wrong?

whitehawk
  • 2,429
  • 29
  • 33

2 Answers2

9

I figured out what the issue was. The .ebextensions folder was hidden in my file system and was not being included in my deployment ZIP when I published to AWS.

whitehawk
  • 2,429
  • 29
  • 33
0

This didn't work for me. Instead, I created a proxy.conf file with just

client_max_body_size 10M;

in it. I put it in a folder named <root>/.platform/nginx/conf.d, zipped it, redeployed it, and all was well. I got this approach from the "Reverse Proxy Configuration | Configuring nginx" section of this page.

John Riehl
  • 1,270
  • 1
  • 11
  • 22