Add new site template: _php_index2

pull/35/head
Emilien Mantel 2017-11-27 13:33:41 +01:00
parent 45f800fe18
commit c79d370ad6
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,19 @@
{% extends "_php.j2" %}
{% block template_upstream_location %}
location = /index.php {
# {{ php_info }}
fastcgi_pass {{ php_upstream }};
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 %}

View File

@ -189,6 +189,8 @@
use_access_log: true use_access_log: true
- name: 'test-php-index.local' - name: 'test-php-index.local'
template: '_php_index' template: '_php_index'
- name: 'test-php-index2.local'
template: '_php_index2'
- name: 'test-proxy.local' - name: 'test-proxy.local'
listen: listen:
- 8080 - 8080
@ -257,6 +259,7 @@
with_items: with_items:
- 'test-php.local' - 'test-php.local'
- 'test-php-index.local' - 'test-php-index.local'
- 'test-php-index2.local'
- name: -- Add HTML file -- - name: -- Add HTML file --
copy: copy:
@ -323,9 +326,16 @@
with_items: "{{ nginx_sites }}" with_items: "{{ nginx_sites }}"
when: > when: >
item.template is defined and item.template is defined and
(item.template == '_php' or item.template == '_php_index') (item.template == '_php' or item.template == '_php_index' or item.template == '_php_index2')
failed_when: p.content.find('PHP Version ' + item.php_version if 'php_version' in item else nginx_php.0.version) == -1 failed_when: p.content.find('PHP Version ' + item.php_version if 'php_version' in item else nginx_php.0.version) == -1
- name: -- VERIFY INDEX2 --
uri:
url: "http://test-php-index2.local/lorem.php?ipsum=sit&dolor=amet"
return_content: yes
register: p2
failed_when: p2.content.find('PHP Version') == -1
# -------------------------------- # --------------------------------
# Basic Auth # Basic Auth
# -------------------------------- # --------------------------------