Эх сурвалжийг харах

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

Add an additional parameter for error_log within virtual hosts
Jeff Geerling 9 жил өмнө
parent
commit
6ae418802b

+ 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"
         index: "index.php index.html index.htm"
         error_page: ""
         error_page: ""
         access_log: ""
         access_log: ""
+        error_log: ""
         extra_parameters: |
         extra_parameters: |
           location ~ \.php$ {
           location ~ \.php$ {
             fastcgi_split_path_info ^(.+\.php)(/.+)$;
             fastcgi_split_path_info ^(.+\.php)(/.+)$;

+ 1 - 0
defaults/main.yml

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

+ 3 - 0
templates/vhosts.j2

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