diff --git a/defaults/main.yml b/defaults/main.yml index 1e6944f..f711e71 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -18,7 +18,12 @@ nginx_vhost_template: "vhost.j2" nginx_worker_processes: "{{ ansible_processor_vcpus | default(ansible_processor_count) }}" nginx_worker_connections: "1024" nginx_multi_accept: "off" -#nginx_use_method: "epoll" + +nginx_extra_events_options: "" +# Example extra events{} options +# nginx_extra_events_options: | +# accept_mutex on; +# use epoll; nginx_error_log: "/var/log/nginx/error.log warn" nginx_access_log: "/var/log/nginx/access.log main buffer=16k flush=2m" diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index b13be94..548082e 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -15,9 +15,10 @@ worker_processes {{ nginx_worker_processes }}; events { worker_connections {{ nginx_worker_connections }}; multi_accept {{ nginx_multi_accept | default('off') }}; -{% if nginx_use_method is defined %} - use {{ nginx_use_method }}; +{% if nginx_extra_events_options %} + {{ nginx_extra_events_options|indent(4, False) }} {% endif %} + } {% endblock %}