1
0

Made refactoring for notes app (and other)

This commit is contained in:
2017-11-26 10:46:04 +03:00
parent 8ec89712f2
commit a59737b826
25 changed files with 205 additions and 221 deletions

View File

@ -0,0 +1,5 @@
---
static_site_name: ''
static_site_dir: '/var/www/{{ static_site_name }}'
static_site_web_root: '{{ static_site_dir }}/current'
static_site_template: site.conf.j2

View File

@ -0,0 +1,15 @@
---
- name: "Create nginx config for {{ static_site_name }} from {{ static_site_template }}."
template:
src: '{{ static_site_template }}'
dest: "/etc/nginx/sites-enabled/{{ static_site_name }}.conf"
notify: restart nginx
- name: "Create root folder for {{ static_site_name }}."
file:
path: "{{ static_site_dir }}"
state: directory
owner: "{{ deploy_user }}"
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 {{ static_site_web_root }};
index index.html;
try_files $uri $uri/ =404;
}
}