location / can be overwrited
parent
d26a6f26f5
commit
f57ab08594
|
@ -28,11 +28,13 @@ server {
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not __location.has_key('/') %}
|
||||||
location / {
|
location / {
|
||||||
{% block template_try_files %}
|
{% block template_try_files %}
|
||||||
try_files {{ override_try_files | default('$uri $uri/ =404') }};
|
try_files {{ override_try_files | default('$uri $uri/ =404') }};
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
}
|
}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block template_upstream_location %}
|
{% block template_upstream_location %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -30,6 +30,11 @@
|
||||||
- 'return 403;'
|
- 'return 403;'
|
||||||
'/gunther':
|
'/gunther':
|
||||||
- 'return 404;'
|
- 'return 404;'
|
||||||
|
- name: 'test-location.local'
|
||||||
|
template: '_base'
|
||||||
|
location:
|
||||||
|
'/':
|
||||||
|
- 'alias /var/tmp;'
|
||||||
- name: 'test-php.local'
|
- name: 'test-php.local'
|
||||||
upstream_params:
|
upstream_params:
|
||||||
- 'fastcgi_param FOO bar;'
|
- 'fastcgi_param FOO bar;'
|
||||||
|
@ -53,7 +58,8 @@
|
||||||
copy: dest="{{ nginx_root }}/{{ item }}/public/index.php" content="<?php phpinfo();"
|
copy: dest="{{ nginx_root }}/{{ item }}/public/index.php" content="<?php phpinfo();"
|
||||||
with_items: ['test-php.local', 'test-php-index.local']
|
with_items: ['test-php.local', 'test-php-index.local']
|
||||||
- name: -- Add HTML file --
|
- name: -- Add HTML file --
|
||||||
copy: dest="{{ nginx_root }}/test.local/public/index.html" content="Index HTML test OK\n"
|
copy: dest="{{ item }}/index.html" content="Index HTML test OK\n"
|
||||||
|
with_items: ['{{ nginx_root }}/test.local/public', '/var/tmp']
|
||||||
- name: -- VERIFY VHOSTS --
|
- name: -- VERIFY VHOSTS --
|
||||||
command: "curl -H 'Host: {{ item.name if item.name is string else item.name[0] }}' http://127.0.0.1{% if item.listen is defined %}:{{ item.listen[0] }}{% endif %}/"
|
command: "curl -H 'Host: {{ item.name if item.name is string else item.name[0] }}' http://127.0.0.1{% if item.listen is defined %}:{{ item.listen[0] }}{% endif %}/"
|
||||||
with_items: nginx_vhosts
|
with_items: nginx_vhosts
|
||||||
|
|
Loading…
Reference in New Issue