mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
Vhost static OK (dirty)
This commit is contained in:
26
templates/etc/nginx/upstream/php.conf.j2
Normal file
26
templates/etc/nginx/upstream/php.conf.j2
Normal file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# {{ 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' %}
|
||||
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 %}
|
||||
}
|
||||
{% else %}
|
||||
#
|
||||
# Bad configuration...
|
||||
#
|
||||
{% endif%}
|
||||
|
||||
# vim:filetype=nginx
|
||||
14
templates/etc/nginx/upstream/php_tcp.j2
Normal file
14
templates/etc/nginx/upstream/php_tcp.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# {{ 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
|
||||
Reference in New Issue
Block a user