aur repo wip
This commit is contained in:
@ -68,14 +68,26 @@
|
||||
mode: "0644"
|
||||
notify: Restart nginx
|
||||
|
||||
- name: Template out nginx site configs
|
||||
- name: Template out nginx reverse proxy configs
|
||||
ansible.builtin.template:
|
||||
src: site.conf.j2
|
||||
src: nginx-proxy.conf.j2
|
||||
dest: /etc/nginx/sites-available/{{ item.name }}.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
loop: "{{ nginx_sites }}"
|
||||
when: item.type == "proxy"
|
||||
notify: Restart nginx
|
||||
|
||||
- name: Template out nginx site configs
|
||||
ansible.builtin.template:
|
||||
src: nginx-site.conf.j2
|
||||
dest: /etc/nginx/sites-available/{{ item.name }}.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
loop: "{{ nginx_sites }}"
|
||||
when: item.type == "site"
|
||||
notify: Restart nginx
|
||||
|
||||
- name: Enable site configs
|
||||
|
18
ansible/roles/nginx/templates/nginx-site.conf.j2
Normal file
18
ansible/roles/nginx/templates/nginx-site.conf.j2
Normal file
@ -0,0 +1,18 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name {{ item.name }};
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name {{ item.name }};
|
||||
ssl_certificate /etc/letsencrypt/live/{{ item.name }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ item.name }}/privkey.pem;
|
||||
index index.html;
|
||||
root {{ item.root }};
|
||||
location / {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user