Przeglądaj źródła

Make possible to define config parameters in nginx http section

Emmanuel Bouthenot 8 lat temu
rodzic
commit
10320b8eb0

+ 1 - 0
roles/webserver/defaults/main.yml

@@ -9,6 +9,7 @@ with_nginx: False
 # nginx_workers ~= $(getconf _NPROCESSORS_ONLN)
 nginx_workers: 2
 nginx_ssl_strengthened: False
+nginx_http_config: Null
 
 with_modphp5: False
 

+ 7 - 0
roles/webserver/templates/nginx/nginx.conf.j2

@@ -177,6 +177,13 @@ http {
 
     ### Extended configuration ###
 
+{% if nginx_http_config %}
+    # Custom settings
+{%for param in nginx_http_config %}
+    {{ param }} {{ nginx_http_config[param] }};
+{% endfor %}
+{% endif %}
+
     # More configuration parameters
     include /etc/nginx/conf.d/*.conf;