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

30 lines
928 B
Django/Jinja

#
# {{ ansible_managed }}
#
{% for php in nginx_php %}
upstream {{ php.upstream_name }} {
{% for sock in php.sockets | default([]) %}
{% if sock.host is defined %}
server {{ sock.host }}:{{ sock.port }} weight={{ sock.weight | default('1') }} max_fails={{ sock.max_fails | default('5') }} fail_timeout={{ sock.fail_timeout | default('10s') }};
{% else %}
server unix:{{ sock.unix }} weight={{ sock.weight | default('1') }};
{% endif %}
{% endfor %}
}
{% endfor %}
{% if ansible_local.hanxhx_php.fpm_pool is defined%}
# -------------------------------------------------------
# Auto-detected PHP config for HanXHX.php ansible role
# -------------------------------------------------------
{% for php in ansible_local.hanxhx_php.fpm_pool %}
upstream {{ php.name }} {
server {% if php.listen.startswith('/') %}unix:{{ php.listen }}{% else %}{{ php.listen }}{% endif %};
}
{% endfor %}
{% endif %}
# vim:filetype=nginx