From aa96ceb9f5481a4da9f4a16dff92d05acc48687d Mon Sep 17 00:00:00 2001 From: ChrisJL Date: Sat, 12 Aug 2023 19:01:01 +0100 Subject: Serve static files from Turing (#116) * Redirect http requests to https * Remove default NGINX site * Remove trailing whitespace from old meeting note * Mount static files * Correct capitalisation of notify directives * Add missing children key to inventory --- roles/nginx/tasks/main.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'roles/nginx/tasks') diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index 266e916..85fe7ec 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -19,4 +19,27 @@ tags: - role::nginx notify: - - reload the nginx service + - Reload the nginx service + +- name: Remove default nginx site + file: + path: /etc/nginx/sites-enabled/default + state: absent + +- name: Copy file server config + copy: + src: files.pydis.wtf + dest: /etc/nginx/sites-available/files.pydis.wtf + group: root + owner: root + mode: "0644" + tags: + - role::nginx + notify: + - Reload the nginx service + +- name: Enable file server + file: + src: /etc/nginx/sites-available/files.pydis.wtf + dest: /etc/nginx/sites-enabled/files.pydis.wtf + state: link -- cgit v1.2.3