3

I am trying to increase the number of possible worker_connections of my nginx on my Beanstalk nodejs server.
I followed the documentation and created a proxy.config file in my .ebextensions folder at the root of my project.

files:
  /etc/nginx/conf.d/proxy.conf:
    mode: "000644"
    owner: root
    group: root
    content: |

      worker_rlimit_nofile 65536;
      events {
        worker_connections  50000;
      }

I re-deployed my project but still get this error [alert] 19144#0: 1024 worker_connections are not enough.

EDIT: I was looking at the documentation for Amazon Linux 1, so here is my new problem: Increasing worker_connections of nginx on Beanstalk nodejs environment

httpete
  • 5,875
  • 4
  • 32
  • 41

1 Answers1

1

/etc/nginx/conf.d/proxy.conf is for Amazon Linux 1.

Since you are using Amazon Linux 2 you should be using .platform/nginx/conf.d/ as shown in the docs, to customize nginx.

Therefore, you could have the following .platform/nginx/conf.d/myconfig.conf with content:

worker_rlimit_nofile 65536;
events {
  worker_connections  50000;
}
Marcin
  • 215,873
  • 14
  • 235
  • 294
  • 1
    Thank you, I was indeed not looking at the right part of the documentation. I now get a `[emerg] "worker_rlimit_nofile" directive is not allowed here in /var/proxy/staging/nginx/conf.d/proxy.conf`. – httpete Feb 22 '21 at 11:06
  • @httpete I'm not expert in nginx settings. Thus not sure what is the correct syntax for this option. But you were using settings for Amazon Linux 1, not 2, thus your options in `proxy.conf` were not recognized at all. – Marcin Feb 22 '21 at 11:17
  • @httpete What happens when you remove `worker_rlimit_nofile 65536;` line? – Marcin Feb 22 '21 at 11:50
  • Same problem with the other lines `[emerg] "events" directive is not allowed here in /var/proxy/staging/nginx/conf.d/proxy.conf:3` – httpete Feb 22 '21 at 12:40