diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd5a1d1..09a79cb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ FEATURES: - Add validation tasks to check the Ansible version, the Jinja2 version, and whether the required Ansible collections for this role are installed. - Bump the Ansible `community.general` collection to `9.2.0`, `community.crypto` collection to `2.21.1` and `community.docker` collection to `3.11.0`. - Add templating support for the `ngx_mgmt_module`, `ngx_http_gzip_static_module`, and `ngx_stream_map_module` NGINX modules. +- Now support uwsgi using the uwsgi_pass directive BUG FIXES: diff --git a/defaults/main/template.yml b/defaults/main/template.yml index 32581693..955b3d6b 100644 --- a/defaults/main/template.yml +++ b/defaults/main/template.yml @@ -293,6 +293,8 @@ nginx_config_http_template: underscores_in_headers: false # Boolean -- Not available in the 'location' context variables_hash_bucket_size: 64 # Available only in the 'http' context variables_hash_max_size: 1024 # Available only in the 'http' context + uwsgi: + pass: upstreamserver http2: # Configure HTTP2 enable: false # Boolean -- Not available in the 'location' context body_preread_size: 64k # Not available in the 'location' context diff --git a/templates/http/default.conf.j2 b/templates/http/default.conf.j2 index e7c00aec..44ce5081 100644 --- a/templates/http/default.conf.j2 +++ b/templates/http/default.conf.j2 @@ -309,6 +309,12 @@ server { {{ core(location['core']) }} {%- endfilter %} {% endif %} +{% if location['uwsgi'] is defined %} +{% from 'http/uwsgi.j2' import uwsgi with context %} +{% filter indent(8) %} + {{ uwsgi(location['uwsgi']) }} +{%- endfilter %} +{% endif %} {% if location['http2'] is defined %} {% from 'http/modules.j2' import http2 with context %} {% filter indent(8) %} diff --git a/templates/http/uwsgi.j2 b/templates/http/uwsgi.j2 new file mode 100644 index 00000000..8e37d22c --- /dev/null +++ b/templates/http/uwsgi.j2 @@ -0,0 +1,5 @@ +{{ ansible_managed | comment }} + +{% if uwsgi['pass'] is defined %} +uwsgi_pass {{ uwsgi['pass'] }} +{% endif %}