Skip to content
Snippets Groups Projects
Verified Commit 018e73b9 authored by Kristian Klausen's avatar Kristian Klausen :tada:
Browse files

nginx: Add option for installing extra modules

This will be used for installing the geoip2 module, so we can make it
more difficult for Chinese bots to crawl the wiki.

The name of the shared object file can be overridden in case it is not
named ngx_http_{{ module.name }}_module.so, e.g. srcache where the
shared object is named ngx_http_srcache_filter_module.so.
parent c7d1ed25
No related branches found
No related tags found
No related merge requests found
letsencrypt_validation_dir: "/var/lib/letsencrypt"
nginx_firewall_zone:
nginx_extra_modules: []
dependencies:
- role: geoipupdate
when: "'geoip2' in (nginx_extra_modules | map(attribute='name') )"
- name: Install nginx
pacman: name=nginx,nginx-mod-brotli state=present
- name: Install extra nginx modules
pacman: name={{ nginx_extra_modules | map(attribute='name') | map('regex_replace', '^', 'nginx-mod-') }} state=present
- name: Install nginx.service snippet
copy: src=nginx.service.d dest=/etc/systemd/system owner=root group=root mode=0644
......
......@@ -2,6 +2,13 @@ worker_processes auto;
load_module /usr/lib/nginx/modules/ngx_http_brotli_filter_module.so;
load_module /usr/lib/nginx/modules/ngx_http_brotli_static_module.so;
{% for module in nginx_extra_modules %}
{% if module.so_name is not defined %}
load_module /usr/lib/nginx/modules/ngx_http_{{ module.name }}_module.so;
{% else %}
load_module /usr/lib/nginx/modules/{{ module.so_name | replace('-', '_') }};
{% endif %}
{% endfor %}
include toplevel-snippets/*.conf;
events {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment