1
0

Add static site single role

This commit is contained in:
2017-07-30 16:53:21 +03:00
parent 7e81d6fe00
commit 861be74b66
6 changed files with 23 additions and 43 deletions

View File

@ -0,0 +1,15 @@
---
- name: Create nginx config
template:
src: site.conf.j2
dest: /etc/nginx/sites-enabled/{{ static_site_name }}.conf
notify: restart nginx
- name: Create root folder
file:
path: /var/www/{{ static_site_name }}
state: directory
owner: deployer
group: www-data
recurse: yes
notify: restart nginx

View File

@ -0,0 +1,15 @@
server {
server_name www.{{ static_site_domain }};
return 301 $scheme://{{ static_site_domain }}$request_uri;
}
server {
listen 80;
server_name {{ static_site_domain }};
location / {
root /var/www/{{ static_site_name }}/current;
index index.html;
try_files $uri $uri/ =404;
}
}