Fix and improve tests/vhosts + php_index vhost

This commit is contained in:
Emilien Mantel
2015-11-02 16:30:46 +01:00
parent c2644d4e5d
commit 97c3d2e169
4 changed files with 41 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ server {
{% if item.root is defined %}
root {{ item.root }};
{% else %}
root {{ nginx_root }}/{{ item.name[0] }}/public;
root {{ nginx_root }}/{{ item.name if item.name is string else item.name[0] }}/public;
{% endif %}
{% block template_index %}
index {{ item.index | default('index.html index.htm') }};

View File

@@ -0,0 +1,24 @@
{% extends "_php.j2" %}
{% block template_upstream_location %}
location = /index.php {
fastcgi_pass php;
fastcgi_index index.php;
{% if item.upstream_params is defined and item.upstream_params is iterable %}
{% for param in item.upstream_params %}
{{ param }}
{% endfor %}
{% endif %}
{% if nginx_version.stdout | version_compare('1.6.1', 'lt') %}
include fastcgi_params;
{% else %}
include fastcgi.conf;
{% endif %}
}
{% endblock %}
{% block template_custom_location %}
location ~ \.(php\d?|phtml)$ {
return 403;
}
{% endblock %}