Fully block Server header
All checks were successful
/ terraform (push) Successful in 31s
/ ansible (push) Successful in 1m46s

This commit is contained in:
Jake Howard 2023-12-16 21:57:19 +00:00
parent cfb498d7c6
commit 46eda36515
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 16 additions and 0 deletions

View file

@ -2,6 +2,7 @@ collections:
- ansible.posix
- community.general
- community.docker
- kewlfft.aur
- name: https://github.com/prometheus-community/ansible
type: git

View file

@ -2,6 +2,8 @@ worker_processes auto;
error_log /var/log/nginx/error.log;
load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so;
pcre_jit on;
events {
@ -13,6 +15,7 @@ http {
default_type application/octet-stream;
server_tokens off;
more_clear_headers "Server";
types_hash_max_size 2048;
types_hash_bucket_size 128;

View file

@ -10,6 +10,18 @@
when: ansible_os_family == 'Archlinux'
become: true
- name: Install nginx-mod-http-headers-more
package:
name: libnginx-mod-http-headers-more-filter
when: ansible_os_family != 'Archlinux'
become: true
- name: Install nginx-mod-http-headers-more on Arch
kewlfft.aur.aur:
name: nginx-mainline-mod-headers-more
when: ansible_os_family == 'Archlinux'
become: true
- name: Create config directories
file:
path: /etc/nginx/{{ item }}