Upstream servers must be in the virtualhost vars.
This commit is contained in:
parent
1f4510181e
commit
44ce326600
|
@ -103,10 +103,6 @@ nginx_logrotate_maxfilesize: "1G"
|
|||
nginx_logrotate_retention: "52"
|
||||
|
||||
nginx_use_common_virthost: False
|
||||
nginx_upstream_backends: []
|
||||
# - name: unicorn
|
||||
# servers:
|
||||
# - 127.0.0.1:4000 fail_timeout=0
|
||||
#
|
||||
# Virtualhost example
|
||||
nginx_virthosts: []
|
||||
|
@ -115,6 +111,10 @@ nginx_virthosts: []
|
|||
# server_name: '{{ ansible_fqdn }}'
|
||||
# server_aliases: ''
|
||||
# index: index.html
|
||||
# upstream_backends:
|
||||
# - name: unicorn
|
||||
# servers:
|
||||
# - 127.0.0.1:4000 fail_timeout=0
|
||||
# error_page: /path_to_error_page.html
|
||||
# ssl_enabled: False
|
||||
# ssl_only: False
|
||||
|
|
|
@ -6,14 +6,16 @@ include /etc/nginx/snippets/nginx-websockets.conf;
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% for u_bk in nginx_upstream_backends %}
|
||||
{% if item.upstream_backends is defined %}
|
||||
{% for u_bk in item.upstream_backends %}
|
||||
upstream {{ u_bk.name }} {
|
||||
{% for srv in u_bk.servers %}
|
||||
server {{ u_bk.srv }};
|
||||
server {{ srv }};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
server {
|
||||
listen {{ item.http_port | default ('80') }};
|
||||
server_name {{ item.server_name }} {% if item.serveraliases is defined %}{{ item.serveraliases }}{% endif %};
|
||||
|
|
Loading…
Reference in New Issue