阅读背景:

AWS Elastic Beanstalk - 请求实体太大(413)

来源:互联网 

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:

我正在尝试将基于节点的Web服务部署到弹性beanstalk,但在发布过多数据时会遇到问题。问题似乎是在nginx层,而不是Node / express层。我收到的消息是:

<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:

基于StackOverflow上的其他答案,我在项目的根目录中添加了一个名为.ebextensions的文件夹和一个名为nginx.config的文件。该文件的内容是:

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?

我将此部署与我的节点应用程序一起部署,甚至重新启动了应用服务器。到目前为止似乎没有任何效果。难道我做错了什么?

1 个解决方案

#1


5  

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.

我弄清楚问题是什么。 .ebextensions文件夹隐藏在我的文件系统中,并且在我发布到AWS时未包含在我的部署ZIP中。


分享到: