From f2608c75971f29581f8519c029a3fbdd8d52b646 Mon Sep 17 00:00:00 2001 From: Fernando Membrive Date: Wed, 12 Jul 2017 10:35:11 +0200 Subject: [PATCH] Load modules before events directive In Nginx 1.12.x (latest stable version) you will have a config error if you try to load modules before the events directive. With this change we avoid this problem. --- templates/nginx.conf.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index cb187d8..7cdec60 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -7,6 +7,10 @@ pid {{ nginx_pidfile }}; worker_processes {{ nginx_worker_processes }}; {% endblock %} +{% if nginx_extra_conf_options %} +{{ nginx_extra_conf_options }} +{% endif %} + {% block events %} events { worker_connections {{ nginx_worker_connections }}; @@ -14,10 +18,6 @@ events { } {% endblock %} -{% if nginx_extra_conf_options %} -{{ nginx_extra_conf_options }} -{% endif %} - http { {% block http_begin %}{% endblock %}