mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
Manages PHP minor versions
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{% extends "_base.j2" %}
|
||||
|
||||
{% macro phpv(version) %}
|
||||
{% if version == 5 %}
|
||||
{{ nginx_upstream_php5 -}}
|
||||
{% elif version == 7 %}
|
||||
{{ nginx_upstream_php7 -}}
|
||||
{% if version == 56 %}
|
||||
{{ nginx_upstream_php56 -}}
|
||||
{% elif version == 70 %}
|
||||
{{ nginx_upstream_php70 -}}
|
||||
{% else %}
|
||||
{# Hack... define another upstream #}
|
||||
{{ version -}}
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
{% if item.php_version is defined %}
|
||||
{% set php_upstream = phpv(item.php_version) %}
|
||||
{% elif nginx_php5 %}
|
||||
{% set php_upstream = phpv(5) %}
|
||||
{% elif nginx_php7 %}
|
||||
{% set php_upstream = phpv(7) %}
|
||||
{% elif nginx_php56 %}
|
||||
{% set php_upstream = phpv(56) %}
|
||||
{% elif nginx_php70 %}
|
||||
{% set php_upstream = phpv(70) %}
|
||||
{% endif %}
|
||||
|
||||
{% block template_index %}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# {{ ansible_managed }}
|
||||
#
|
||||
|
||||
{% if nginx_php5 %}
|
||||
upstream {{ nginx_upstream_php5 }} {
|
||||
{% for item in nginx_php5_sockets %}
|
||||
{% if nginx_php56 %}
|
||||
upstream {{ nginx_upstream_php56 }} {
|
||||
{% for item in nginx_php56_sockets %}
|
||||
{% if item.unix_socket is defined %}
|
||||
server unix:{{ item.unix_socket }} weight={{ item.weight | default('1') }};
|
||||
{% else %}
|
||||
@@ -14,9 +14,9 @@ upstream {{ nginx_upstream_php5 }} {
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
{% if nginx_php7 %}
|
||||
upstream {{ nginx_upstream_php7 }} {
|
||||
{% for item in nginx_php7_sockets %}
|
||||
{% if nginx_php70 %}
|
||||
upstream {{ nginx_upstream_php70 }} {
|
||||
{% for item in nginx_php70_sockets %}
|
||||
{% if item.unix_socket is defined %}
|
||||
server unix:{{ item.unix_socket }} weight={{ item.weight | default('1') }};
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user