I am trying to increase the number of possible worker_connections
of my nginx on my Beanstalk nodejs server (Amazon Linux 2).
I followed the documentation and created a file .platform/nginx/conf.d/proxy.conf
with this content:
worker_rlimit_nofile 65536;
events {
worker_connections 32768;
}
When deploying I get the error:
[emerg] "worker_rlimit_nofile" directive is not allowed here in /var/proxy/staging/nginx/conf.d/proxy.conf
When commenting this line I still get:
[emerg] "events" directive is not allowed here in /var/proxy/staging/nginx/conf.d/proxy.conf:3
2
Answers
I think these are top level settings, and you have to overwrite main
nginx.conf
file. You do this by creating.platform/nginx/nginx.conf
config file. In that case, you can remove.platform/nginx/conf.d/proxy.conf
.You can try the following
.platform/nginx/nginx.conf
:If this does not work, you can ssh into your EB instance, check what is the actual, default
nginx.conf
(/etc/nginx/nginx.conf
) for your EB environment, copy it, and use in.platform/nginx/nginx.conf
.@marcin’s answer above is correct. Making updates to worker_connections requires modification via the
.platform/nginx/nginx.conf
file. For other’s reference, as of July 2021, AWS is using the following as a default for nginx.conf on Elastic Beanstalk v2 and Amazon Linux 2:Simply add the above file to
.platform/nginx/nginx.conf
and modify the worker_connections value to the desired value. AWS docs are lacking on this currently, but I’ve requested they make further updates.