Преглед изворни кода

Merge pull request #38 from opdavies/vhost-add-error-log

Add an additional parameter for error_log within virtual hosts
Jeff Geerling пре 9 година
родитељ
комит
6ae418802b
3 измењених фајлова са 5 додато и 0 уклоњено
  1. 1 0
      README.md
  2. 1 0
      defaults/main.yml
  3. 3 0
      templates/vhosts.j2

+ 1 - 0
README.md

@@ -25,6 +25,7 @@ A list of vhost definitions (server blocks) for Nginx virtual hosts. If left emp
         index: "index.php index.html index.htm"
         error_page: ""
         access_log: ""
+        error_log: ""
         extra_parameters: |
           location ~ \.php$ {
             fastcgi_split_path_info ^(.+\.php)(/.+)$;

+ 1 - 0
defaults/main.yml

@@ -30,6 +30,7 @@ nginx_vhosts: []
 #   # Properties that are only added if defined:
 #   error_page: ""
 #   access_log: ""
+#   error_log: ""
 #   extra_parameters: "" # Can be used to add extra config blocks (multiline).
 
 nginx_upstreams: []

+ 3 - 0
templates/vhosts.j2

@@ -12,6 +12,9 @@ server {
     {% if vhost.access_log is defined %}
     access_log {{ vhost.access_log }};
     {% endif %}
+    {% if vhost.error_log is defined %}
+    error_log {{ vhost.error_log }} error;
+    {% endif %}
 
     {% if vhost.return is defined %}
     return {{ vhost.return }};