PHP works

This commit is contained in:
Emilien Mantel
2015-07-15 16:26:27 +02:00
parent 1d025d1f35
commit 721606056d
6 changed files with 24 additions and 41 deletions

View File

@@ -1,26 +1,22 @@
#
# {{ ansible_managed }}
#
{% if nginx_php_method == 'unix' %}
upstream php {
{% for item in php_fpm_unix_sockets %}
server unix:{{ item }};
{% endfor %}
}
{% elif nginx_php_method == 'tcp' %}
{% if nginx_php_method == 'tcp' %}
upstream php {
{% if nginx_cluster_php_method is defined %}
{{ nginx_cluster_php_method }};
{% endif %}
{% for item in nginx_cluster_servers %}
{% for item in nginx_php_tcp_sockets %}
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 %}
}
{% elif nginx_php_method == 'unix' %}
upstream php {
{% for item in nginx_php_unix_sockets %}
server unix:{{ item }};
{% endfor %}
}
{% else %}
#
# Bad configuration...
#
{% endif%}
{% endif %}
# vim:filetype=nginx

View File

@@ -1,14 +0,0 @@
#
# {{ ansible_managed }}
#
upstream php {
{% if nginx_cluster_php_method is defined %}
{{ nginx_cluster_php_method }};
{% endif %}
{% for item in nginx_cluster_servers %}
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 %}
}
# vim:filetype=nginx