fixes to nginx conf
This commit is contained in:
parent
14dcfb436d
commit
e05314cbc1
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
- name: Create site dir
|
- name: Create site dir
|
||||||
file:
|
file:
|
||||||
path: "statis_nginx_site"
|
path: "/home/{{ ansible_user }}/web/static_nginx_site"
|
||||||
state: directory
|
state: directory
|
||||||
register: site_dir
|
register: site_dir
|
||||||
|
|
||||||
|
|
@ -17,6 +17,19 @@
|
||||||
src: templates/index.html.j2
|
src: templates/index.html.j2
|
||||||
dest: "{{site_dir.path}}/index.html"
|
dest: "{{site_dir.path}}/index.html"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Create nginx conf dir
|
||||||
|
file:
|
||||||
|
path: "/home/{{ ansible_user }}/nginx/conf"
|
||||||
|
state: directory
|
||||||
|
register: nginx_conf_dir
|
||||||
|
|
||||||
|
- name: Copy nginx config
|
||||||
|
template:
|
||||||
|
src: templates/nginx.conf.j2
|
||||||
|
dest: "{{ nginx_conf_dir.path }}/nginx.conf"
|
||||||
|
|
||||||
|
|
||||||
- name: Create container
|
- name: Create container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: nginx-static
|
name: nginx-static
|
||||||
|
|
@ -25,5 +38,6 @@
|
||||||
- "80:80"
|
- "80:80"
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ site_dir.path }}:/usr/share/nginx/html"
|
- "{{ site_dir.path }}:/usr/share/nginx/html"
|
||||||
|
- "{{ nginx_conf_dir.path }}:/etc/nginx/conf.d"
|
||||||
restart_policy : "unless-stopped"
|
restart_policy : "unless-stopped"
|
||||||
init : true
|
init : true
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
root /var/www/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue