upstream backends in the virtualhost template.
This commit is contained in:
parent
437d0a0b1e
commit
1f4510181e
|
|
@ -103,8 +103,13 @@ nginx_logrotate_maxfilesize: "1G"
|
||||||
nginx_logrotate_retention: "52"
|
nginx_logrotate_retention: "52"
|
||||||
|
|
||||||
nginx_use_common_virthost: False
|
nginx_use_common_virthost: False
|
||||||
|
nginx_upstream_backends: []
|
||||||
|
# - name: unicorn
|
||||||
|
# servers:
|
||||||
|
# - 127.0.0.1:4000 fail_timeout=0
|
||||||
|
#
|
||||||
# Virtualhost example
|
# Virtualhost example
|
||||||
# nginx_virthosts:
|
nginx_virthosts: []
|
||||||
# - virthost_name: '{{ ansible_fqdn }}'
|
# - virthost_name: '{{ ansible_fqdn }}'
|
||||||
# listen: '{{ http_port }}'
|
# listen: '{{ http_port }}'
|
||||||
# server_name: '{{ ansible_fqdn }}'
|
# server_name: '{{ ansible_fqdn }}'
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,14 @@ include /etc/nginx/snippets/nginx-websockets.conf;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% for u_bk in nginx_upstream_backends %}
|
||||||
|
upstream {{ u_bk.name }} {
|
||||||
|
{% for srv in u_bk.servers %}
|
||||||
|
server {{ u_bk.srv }};
|
||||||
|
{% endfor %}
|
||||||
|
}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
server {
|
server {
|
||||||
listen {{ item.http_port | default ('80') }};
|
listen {{ item.http_port | default ('80') }};
|
||||||
server_name {{ item.server_name }} {% if item.serveraliases is defined %}{{ item.serveraliases }}{% endif %};
|
server_name {{ item.server_name }} {% if item.serveraliases is defined %}{{ item.serveraliases }}{% endif %};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue