diff --git a/README.md b/README.md index d19e23e..2396d74 100644 --- a/README.md +++ b/README.md @@ -335,6 +335,7 @@ nginx_main_template: conf_file_location: /etc/nginx/ user: nginx worker_processes: auto + #worker_rlimit_nofile: 1024 error_level: warn worker_connections: 1024 http_enable: true diff --git a/defaults/main.yml b/defaults/main.yml index f7556cb..9ebaea5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -146,6 +146,7 @@ nginx_main_template: conf_file_location: /etc/nginx/ user: nginx worker_processes: auto + #worker_rlimit_nofile: 1024 error_level: warn worker_connections: 1024 http_enable: true diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index 00f30c0..82a6216 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -34,6 +34,10 @@ load_module modules/ngx_http_modsecurity_module.so; user {{ nginx_main_template.user }}; worker_processes {{ nginx_main_template.worker_processes }}; +{% if nginx_main_template.worker_rlimit_nofile is defined %} +worker_rlimit_nofile {{ nginx_main_template.worker_rlimit_nofile }}; +{% endif %} + error_log /var/log/nginx/error.log {{ nginx_main_template.error_level }}; pid /var/run/nginx.pid;