diff --git a/templates/nginx/conf.d/log.conf b/templates/nginx/conf.d/log.conf index 8acb1c0e93c9bc2d68ed3af84fb0d5e31ca65f97..9ea37320f6dd40d10ad308ef9c4d7f1283ee1242 100644 --- a/templates/nginx/conf.d/log.conf +++ b/templates/nginx/conf.d/log.conf @@ -1,2 +1,4 @@ +{% if nginx["version"]|version_compare("1.7.11", ">=") %} access_log {{ nginx_access_log }}; error_log {{ nginx_error_log }}; +{% endif %} diff --git a/tests/test_nginx.py b/tests/test_nginx.py index b941d2e33f6e7bf7b15fd8f2d09a4464115e0491..f9fe73643f88d3563bd40e91de47a09dc6a337c4 100644 --- a/tests/test_nginx.py +++ b/tests/test_nginx.py @@ -23,15 +23,6 @@ def test_nginx_include_directive(File, directive): assert directive in File('/etc/nginx/nginx.conf').content_string -log_directives = ['access_log syslog:server=127.0.0.1;', - 'error_log syslog:server=127.0.0.1;'] - - -@pytest.mark.parametrize('directive', log_directives) -def test_nginx_log_directive(File, directive): - assert directive in File('/etc/nginx/conf.d/log.conf').content_string - - def test_nginx_config(File, Command, Sudo): with Sudo(): assert Command('nginx -t').rc == 0