diff --git a/defaults/main.yml b/defaults/main.yml index 87563ad..bc28a95 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,9 +21,9 @@ nginx_dh_length: 2048 # # PHP -nginx_php: false +nginx_php: false nginx_php_method: "unix" -nginx_php_sockets: +nginx_php_sockets: - unix: "/var/run/php5-fpm.sock" - host: "127.0.0.1" port: "15000" diff --git a/templates/etc/nginx/upstream/php.conf.j2 b/templates/etc/nginx/upstream/php.conf.j2 index 2f086f9..dc4cd52 100644 --- a/templates/etc/nginx/upstream/php.conf.j2 +++ b/templates/etc/nginx/upstream/php.conf.j2 @@ -3,13 +3,13 @@ # upstream php { - {% for item in nginx_php_sockets %} - {% if item.unix_socket is defined %} +{% for item in nginx_php_sockets %} +{% if item.unix_socket is defined %} server unix:{{ item.unix_socket }} weight={{ item.weight | default('1') }}; - {% else %} +{% else %} server {{ item.host }}:{{ item.port }} weight={{ item.weight | default('1') }} max_fails={{ item.max_fails | default('5') }} fail_timeout={{ item.fail_timeout | default('10s') }}; - {% endif %} - {% endfor %} +{% endif %} +{% endfor %} } # vim:filetype=nginx