mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
Test proxy with a real back-end: himself
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
nginx_upstreams:
|
||||
- name: 'test'
|
||||
servers:
|
||||
- name: '127.0.0.1:10000'
|
||||
- name: '127.0.0.1:80'
|
||||
max_conns: 150
|
||||
weight: 10
|
||||
down: false
|
||||
@@ -37,6 +37,8 @@
|
||||
template: '_php'
|
||||
- name:
|
||||
- 'test-proxy.local'
|
||||
listen:
|
||||
- 8080
|
||||
template: '_proxy'
|
||||
upstream_name: 'test'
|
||||
- name:
|
||||
@@ -51,7 +53,7 @@
|
||||
- name: -- Add HTML file --
|
||||
copy: dest="{{ nginx_root }}/test.local/public/index.html" content="Index HTML test OK\n"
|
||||
- name: -- VERIFY VHOSTS --
|
||||
shell: "curl -H 'Host: {{ item.name[0] }}' http://127.0.0.1/"
|
||||
shell: "curl -H 'Host: {{ item.name[0] }}' http://127.0.0.1{% if item.listen is defined and item.listen is iterable %}:{{ item.listen[0] }}{% endif %}/"
|
||||
with_items: nginx_vhosts
|
||||
when: item.delete is undefined or not item.delete
|
||||
changed_when: false
|
||||
|
||||
Reference in New Issue
Block a user