2015-07-30 18:02:21 +07:00
|
|
|
{% extends "_base.j2" %}
|
2016-08-09 21:02:09 +07:00
|
|
|
|
|
|
|
{% if item.php_version is defined %}
|
2017-10-26 15:59:24 +07:00
|
|
|
{% set php_info = 'Explicit PHP version on site' %}
|
|
|
|
{% set php_upstream = (nginx_php|selectattr('version', 'equalto', item.php_version)|first).upstream_name | default(item.php_version | php_default_upstream_name) %}
|
|
|
|
{% elif item.php_upstream is defined %}
|
|
|
|
{% set php_info = 'Explicit Nginx/PHP upstream on site' %}
|
|
|
|
{% set php_upstream = item.php_upstream %}
|
|
|
|
{% else %}
|
|
|
|
{% set php_info = 'Warning: using first PHP version on config' %}
|
|
|
|
{% set php_upstream = nginx_php.0.upstream_name | default(nginx_php.0.version | php_default_upstream_name) %}
|
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 %}
|
2019-02-20 23:08:56 +07:00
|
|
|
try_files {{ item.override_try_files | default('$uri $uri/ =404') }};
|
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$ {
|
2017-10-26 15:59:24 +07:00
|
|
|
# {{ php_info }}
|
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
|
|
|
include fastcgi.conf;
|
|
|
|
}
|
|
|
|
{% endblock %}
|