2015-07-30 18:02:21 +07:00
|
|
|
{% extends "_base.j2" %}
|
2016-08-09 21:02:09 +07:00
|
|
|
|
|
|
|
{% macro phpv(version) %}
|
2016-08-11 16:30:26 +07:00
|
|
|
{% if version == 56 %}
|
|
|
|
{{ nginx_upstream_php56 -}}
|
|
|
|
{% elif version == 70 %}
|
|
|
|
{{ nginx_upstream_php70 -}}
|
2016-08-09 21:02:09 +07:00
|
|
|
{% else %}
|
|
|
|
{# Hack... define another upstream #}
|
|
|
|
{{ version -}}
|
|
|
|
{% endif %}
|
|
|
|
{%- endmacro -%}
|
|
|
|
|
|
|
|
{% if item.php_version is defined %}
|
|
|
|
{% set php_upstream = phpv(item.php_version) %}
|
2016-08-11 16:30:26 +07:00
|
|
|
{% elif nginx_php56 %}
|
|
|
|
{% set php_upstream = phpv(56) %}
|
|
|
|
{% elif nginx_php70 %}
|
|
|
|
{% set php_upstream = phpv(70) %}
|
2016-08-09 21:02:09 +07:00
|
|
|
{% endif %}
|
|
|
|
|
2015-07-30 18:02:21 +07:00
|
|
|
{% block template_index %}
|
|
|
|
index {{ item.index | default('index.html index.htm index.php') }};
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block template_try_files %}
|
2015-10-15 21:21:36 +07:00
|
|
|
try_files {{ override_try_files | default('$uri $uri/ /index.php') }};
|
2015-07-30 18:02:21 +07:00
|
|
|
{% endblock %}
|
|
|
|
|
2015-07-30 20:37:25 +07:00
|
|
|
{% block template_upstream_location %}
|
2015-07-30 18:02:21 +07:00
|
|
|
location ~ \.php$ {
|
2016-08-09 21:02:09 +07:00
|
|
|
fastcgi_pass {{ php_upstream }};
|
2015-07-30 18:02:21 +07:00
|
|
|
fastcgi_index index.php;
|
2015-09-21 16:47:49 +07:00
|
|
|
{% if item.upstream_params is defined and item.upstream_params is iterable %}
|
|
|
|
{% for param in item.upstream_params %}
|
|
|
|
{{ param }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2015-07-30 18:02:21 +07:00
|
|
|
{% if nginx_version.stdout | version_compare('1.6.1', 'lt') %}
|
|
|
|
include fastcgi_params;
|
|
|
|
{% else %}
|
|
|
|
include fastcgi.conf;
|
|
|
|
{% endif %}
|
|
|
|
}
|
|
|
|
{% endblock %}
|