--- # Security Configuration for Nginx - name: Create security headers configuration template: src: security-headers.conf.j2 dest: "{{ nginx_conf_d_path }}/security-headers.conf" owner: root group: root mode: '0644' notify: restart nginx tags: - nginx - security - headers - name: Configure SSL settings template: src: ssl-settings.conf.j2 dest: "{{ nginx_conf_d_path }}/ssl-settings.conf" owner: root group: root mode: '0644' when: ssl_provider is defined notify: restart nginx tags: - nginx - ssl - security - name: Remove default Nginx site file: path: "{{ nginx_sites_enabled_path }}/default" state: absent notify: restart nginx tags: - nginx - security