netter nging location definition
This commit is contained in:
parent
a9ff4f484b
commit
5d36d9edc5
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# domain, webroot
|
# domain, webroot
|
||||||
roundcube_domain: example.com
|
roundcube_domain: default
|
||||||
roundcube_web_root: /
|
roundcube_web_root: /roundcube
|
||||||
|
|
||||||
# container
|
# container
|
||||||
roundcube_image: roundcube/roundcubemail
|
roundcube_image: roundcube/roundcubemail
|
||||||
|
@ -66,23 +66,28 @@
|
|||||||
- name: "{{ docker_network_name }}"
|
- name: "{{ docker_network_name }}"
|
||||||
ports:
|
ports:
|
||||||
|
|
||||||
- name: template nginx config
|
- name: template nginx domain config
|
||||||
copy:
|
when: roundcube_domain != 'default'
|
||||||
content: |
|
include_role:
|
||||||
location {{ roundcube_web_root }} {
|
name: nginx-docker
|
||||||
|
tasks_from: domain.yml
|
||||||
|
vars:
|
||||||
|
ng_domain_name: "{{ roundcube_domain }}"
|
||||||
|
|
||||||
|
- name: template nginx location config
|
||||||
|
include_role:
|
||||||
|
name: nginx-docker
|
||||||
|
tasks_from: location.yml
|
||||||
|
vars:
|
||||||
|
ng_domain_name: "{{ roundcube_domain }}"
|
||||||
|
ng_location_name: "{{ roundcube_web_root }}"
|
||||||
|
ng_location_content: |
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_pass http://{{ roundcube_container }};
|
proxy_pass http://{{ roundcube_container }};
|
||||||
}
|
|
||||||
dest: "{{ nginx_location_mountpoint }}/roundcube.conf"
|
|
||||||
register: ngconf
|
|
||||||
|
|
||||||
- name: restart frontend
|
- meta: run_handlers
|
||||||
docker_container:
|
|
||||||
name: "{{ nginx_container_name }}"
|
|
||||||
restart: yes
|
|
||||||
when: ngconf is changed
|
|
||||||
|
|
||||||
- name: inspect roundcube volume
|
- name: inspect roundcube volume
|
||||||
docker_volume_info:
|
docker_volume_info:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user