Add keepalive option to upstreams configuration

pull/65/head
Thiago Caiubi 8 years ago
parent e818255465
commit 86a18f8fd1
  1. 1
      defaults/main.yml
  2. 3
      templates/nginx.conf.j2

@ -59,6 +59,7 @@ nginx_vhosts: []
nginx_upstreams: []
# - name: myapp1
# strategy: "ip_hash" # "least_conn", etc.
# keepalive: 16 # optional
# servers: {
# "srv1.example.com",
# "srv2.example.com weight=3",

@ -53,6 +53,9 @@ http {
{% for server in upstream.servers %}
server {{ server }};
{% endfor %}
{% if upstream.keepalive is defined %}
keepalive {{ upstream.keepalive }};
{% endif %}
}
{% endfor %}