new nginx configuration
This commit is contained in:
parent
1062d3422a
commit
00bfc3845d
@ -52,32 +52,21 @@
|
||||
# details)
|
||||
WORDPRESS_CONFIG_EXTRA: "{{ wordpress_config_extra }}"
|
||||
networks:
|
||||
- name: "{{ docker_network_name }}"
|
||||
- name: "{{ docker_network }}"
|
||||
ports:
|
||||
|
||||
- name: template nginx config
|
||||
copy:
|
||||
content: |
|
||||
server {
|
||||
listen 80; # para debug
|
||||
listen 443 ssl;
|
||||
server_name {{ wordpress_domain }};
|
||||
|
||||
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: export nginx config
|
||||
set_fact:
|
||||
nginx_config: >-
|
||||
{{ nginx_config | default({}) | combine({
|
||||
wordpress_domain: {
|
||||
"locations": {
|
||||
wordpress_web_root.rstrip('/')+'/': {
|
||||
"proxy_pass": "http://{}:8080/".format(wordpress_container)
|
||||
}
|
||||
}
|
||||
}
|
||||
}) }}
|
||||
|
||||
- name: inspect wordpress volume
|
||||
docker_volume_info:
|
||||
|
Loading…
x
Reference in New Issue
Block a user