ansible-nginx/templates/etc/nginx/upstream/php.conf.j2

23 lines
591 B
Plaintext
Raw Normal View History

2015-07-15 20:18:51 +07:00
#
# {{ ansible_managed }}
#
2015-07-15 21:26:27 +07:00
{% if nginx_php_method == 'tcp' %}
2015-07-15 20:18:51 +07:00
upstream php {
{% if nginx_cluster_php_method is defined %}
{{ nginx_cluster_php_method }};
{% endif %}
2015-07-15 21:26:27 +07:00
{% for item in nginx_php_tcp_sockets %}
2015-07-15 20:18:51 +07:00
server {{ item.host }}:{{ item.port }} weight={{ item.weight | default('100') }} max_fails={{ item.max_fails | default('5') }} fail_timeout={{ item.fail_timeout | default('10s') }};
{% endfor %}
}
2015-07-15 21:26:27 +07:00
{% elif nginx_php_method == 'unix' %}
upstream php {
{% for item in nginx_php_unix_sockets %}
server unix:{{ item }};
{% endfor %}
}
2015-07-15 20:18:51 +07:00
{% else %}
2015-07-15 21:26:27 +07:00
{% endif %}
2015-07-15 20:18:51 +07:00
# vim:filetype=nginx