new nginx configuration
This commit is contained in:
parent
1062d3422a
commit
00bfc3845d
@ -52,32 +52,21 @@
|
|||||||
# details)
|
# details)
|
||||||
WORDPRESS_CONFIG_EXTRA: "{{ wordpress_config_extra }}"
|
WORDPRESS_CONFIG_EXTRA: "{{ wordpress_config_extra }}"
|
||||||
networks:
|
networks:
|
||||||
- name: "{{ docker_network_name }}"
|
- name: "{{ docker_network }}"
|
||||||
ports:
|
ports:
|
||||||
|
|
||||||
- name: template nginx config
|
- name: export nginx config
|
||||||
copy:
|
set_fact:
|
||||||
content: |
|
nginx_config: >-
|
||||||
server {
|
{{ nginx_config | default({}) | combine({
|
||||||
listen 80; # para debug
|
wordpress_domain: {
|
||||||
listen 443 ssl;
|
"locations": {
|
||||||
server_name {{ wordpress_domain }};
|
wordpress_web_root.rstrip('/')+'/': {
|
||||||
|
"proxy_pass": "http://{}:8080/".format(wordpress_container)
|
||||||
location {{ wordpress_web_root }} {
|
|
||||||
proxy_pass http://{{ wordpress_container }}:8080;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dest: "{{ nginx_config_mountpoint }}/wordpress.conf"
|
}
|
||||||
register: ngconf
|
}) }}
|
||||||
|
|
||||||
- name: restart frontend
|
|
||||||
docker_container:
|
|
||||||
name: "{{ nginx_container_name }}"
|
|
||||||
restart: yes
|
|
||||||
when: ngconf is changed
|
|
||||||
|
|
||||||
- name: inspect wordpress volume
|
- name: inspect wordpress volume
|
||||||
docker_volume_info:
|
docker_volume_info:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user