diff --git a/templates/etc/nginx/sites-available/_php_index2.j2 b/templates/etc/nginx/sites-available/_php_index2.j2 new file mode 100644 index 0000000..3116993 --- /dev/null +++ b/templates/etc/nginx/sites-available/_php_index2.j2 @@ -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 %} diff --git a/tests/test.yml b/tests/test.yml index 0f7189b..e75901c 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -189,6 +189,8 @@ use_access_log: true - name: 'test-php-index.local' template: '_php_index' + - name: 'test-php-index2.local' + template: '_php_index2' - name: 'test-proxy.local' listen: - 8080 @@ -257,6 +259,7 @@ with_items: - 'test-php.local' - 'test-php-index.local' + - 'test-php-index2.local' - name: -- Add HTML file -- copy: @@ -323,9 +326,16 @@ with_items: "{{ nginx_sites }}" when: > 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 + - 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 # --------------------------------