From 5ce506eb3d51a538e30f7946e73564ac12ec28ef Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 14 Dec 2020 20:25:08 +0100 Subject: [PATCH] add resolver to nginx --- defaults/main.yml | 2 +- templates/nginx.conf.j2 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 85fa48a..d5191c8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -31,7 +31,7 @@ nginx_keepalive_timeout: "65" nginx_keepalive_requests: "100" nginx_server_tokens: "on" - +nginx_server_resolver: "" nginx_client_max_body_size: "64m" nginx_server_names_hash_bucket_size: "64" diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index 74cd591..63d0a13 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -53,7 +53,9 @@ http { {% if nginx_extra_http_options %} {{ nginx_extra_http_options|indent(4, False) }} {% endif %} - +{%if nginx_server_resolver %} + resolver {{nginx_server_resolver}}; +{% endif %} {% block http_upstream %} {% for upstream in nginx_upstreams %} upstream {{ upstream.name }} {