diff --git a/bench/config/templates/nginx.conf b/bench/config/templates/nginx.conf index 4af72ab4..666af1bf 100644 --- a/bench/config/templates/nginx.conf +++ b/bench/config/templates/nginx.conf @@ -113,6 +113,11 @@ server { {% endfor -%} + # logs in var + access_log /var/log/nginx/{{ site_name }}_access.log main; + error_log /var/log/nginx/{{ site_name }}_error.log; + + # optimizations sendfile on; keepalive_timeout 15; diff --git a/bench/playbooks/roles/fail2ban/defaults/main.yml b/bench/playbooks/roles/fail2ban/defaults/main.yml index 5aae2800..81019070 100644 --- a/bench/playbooks/roles/fail2ban/defaults/main.yml +++ b/bench/playbooks/roles/fail2ban/defaults/main.yml @@ -1,5 +1,5 @@ --- -fail2ban_nginx_access_log: /var/log/nginx/access.log +fail2ban_nginx_access_log: /var/log/nginx/*access.log maxretry: 6 bantime: 600 -findtime: 600 \ No newline at end of file +findtime: 600 diff --git a/bench/playbooks/roles/fail2ban/tasks/configure_nginx_jail.yml b/bench/playbooks/roles/fail2ban/tasks/configure_nginx_jail.yml index 4d2ede07..b9ced995 100644 --- a/bench/playbooks/roles/fail2ban/tasks/configure_nginx_jail.yml +++ b/bench/playbooks/roles/fail2ban/tasks/configure_nginx_jail.yml @@ -5,7 +5,10 @@ vars_files: - ../defaults/main.yml tasks: + + - name: Setup filter + template: src="../templates/nginx-proxy-filter.conf.j2" dest="/etc/fail2ban/filter.d/nginx-proxy.conf" - name: Setup jail template: src="../templates/nginx-proxy-jail.conf.j2" dest="/etc/fail2ban/jail.d/nginx-proxy.conf" - name: restart service - service: name=fail2ban state=restarted \ No newline at end of file + service: name=fail2ban state=restarted