Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ nginx_yum_pkg: nginx
nginx_yum_enablerepo: nginx
nginx_yum_disablerepo: no
nginx_apt_use_ppa_repo: yes # Use of nginx PPA repo
nginx_enable_dynamic_modules: no # Enable dynamic modules like geo
20 changes: 13 additions & 7 deletions templates/nginx.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# This file was generated by Ansible for {{ ansible_fqdn }}
# Do NOT modify this file by hand!

{% if nginx_enable_dynamic_modules %}
include {{ nginx_dir }}/modules-enabled/*;
{% endif %}

user {{nginx_user}};
worker_processes {{nginx_worker_processes}};

Expand All @@ -9,6 +13,11 @@ events {
worker_connections {{nginx_worker_connections}};
}

{% if nginx_streams_dir %}
stream {
include {{nginx_streams_dir}}/*;
}
{% endif %}

http {
include mime.types;
Expand Down Expand Up @@ -37,13 +46,13 @@ http {

server_names_hash_bucket_size {{nginx_server_names_hash_bucket_size}};

access_log {{nginx_access_log}};
error_log {{nginx_error_log}};

{% if nginx_http_options %}{% for option in nginx_http_options %}
{{option}}
{% endfor %}{% endif %}

access_log {{nginx_access_log}};
error_log {{nginx_error_log}};

{% if nginx_status %}
server {
listen {{ nginx_status }};
Expand All @@ -58,13 +67,10 @@ http {

{% if nginx_servers %}{% for server_config in nginx_servers %}
server {

{{ server_config.split('\n')|join('\t\n') }}

{{ server_config.split('\n')|join('\t\n') }}
}
{% endfor %}{% endif %}

include {{nginx_dir}}/conf.d/*.conf;
include {{nginx_sites_dir}}/*;

}