Skip to content

+ allow to set log_format (switch order of log_file with http options #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
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}}/*;

}