mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-28 09:22:10 +07:00
Move upstream templates to conf.d
This commit is contained in:
20
templates/etc/nginx/conf.d/php.conf.j2
Normal file
20
templates/etc/nginx/conf.d/php.conf.j2
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# {{ ansible_managed }}
|
||||
#
|
||||
|
||||
{% for php in nginx_php %}
|
||||
upstream {{ php.upstream_name | default((php.version | php_default_upstream_name)) }} {
|
||||
{% for sock in php.sockets | default([]) %}
|
||||
{% if php.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 | default((php.version | php_default_upstream_socket)) }} weight={{ sock.weight | default('1') }};
|
||||
{% endif %}
|
||||
{% else %}
|
||||
server unix:{{ php.version | php_default_upstream_socket }} weight=1;
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
# vim:filetype=nginx
|
||||
Reference in New Issue
Block a user