Skip to content

Commit

Permalink
Add a max open files parameter, check if a security header is not emp…
Browse files Browse the repository at this point in the history
…ty before writing it
  • Loading branch information
medanthelinium committed Jul 24, 2024
1 parent f6baddf commit fbdb26a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ nginx:
config: "/usr/local/etc/modsecurity"
log: /var/log/modsecurity
worker_processes: 8
worker_rlimit_nofile:
user: "{{ 'www-data' if ansible_system == 'Linux' else 'www' }}"
nameservers:
- '[2606:4700:4700::1111]:53'
Expand Down
2 changes: 2 additions & 0 deletions templates/include/security_headers.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% for i in nginx_security_headers_merged %}
{% if i['value'] and (i['value'] | length > 0) %}
add_header {{ i['header'] }} "{{ i['value'] }}"{% if i['always'] | default(False) %} always{% endif %};
{% endif %}
{% endfor %}
4 changes: 4 additions & 0 deletions templates/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ load_module {{ nginx.dynamic_modules_path }}/{{ module }};

worker_processes {{ nginx.worker_processes }};

{% if nginx.worker_rlimit_nofile %}
worker_rlimit_nofile {{ nginx.worker_rlimit_nofile }};
{% endif %}

events {
worker_connections 1024;
}
Expand Down

0 comments on commit fbdb26a

Please sign in to comment.