mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
In between commit development coporate design for flock.town
This commit is contained in:
6
roles/nginx-serve-files/README.md
Normal file
6
roles/nginx-serve-files/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Nginx Homepage Role
|
||||
|
||||
This Ansible role configures an Nginx server to serve files. It handles domain configuration, SSL certificate retrieval with Let's Encrypt.
|
||||
|
||||
## Author Information
|
||||
This role was created in 2023 by [Kevin Veen Birkenbach](https://www.veen.world/).
|
3
roles/nginx-serve-files/meta/main.yml
Normal file
3
roles/nginx-serve-files/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
dependencies:
|
||||
- nginx-https
|
||||
- git
|
5
roles/nginx-serve-files/tasks/main.yml
Normal file
5
roles/nginx-serve-files/tasks/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: generate {{domains[application_id]}}.conf
|
||||
template:
|
||||
src: "nginx.conf.j2"
|
||||
dest: "{{nginx.directories.http.servers}}{{domains[application_id]}}.conf"
|
24
roles/nginx-serve-files/templates/nginx.conf.j2
Normal file
24
roles/nginx-serve-files/templates/nginx.conf.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
server
|
||||
{
|
||||
server_name {{domains[application_id]}};
|
||||
|
||||
{% include 'roles/letsencrypt/templates/ssl_header.j2' %}
|
||||
|
||||
{% include 'roles/nginx-modifier-all/templates/global.includes.conf.j2'%}
|
||||
charset utf-8;
|
||||
|
||||
location /
|
||||
{
|
||||
alias {{nginx.directories.homepage.files}}; {# Path to your file directory #}
|
||||
autoindex on; {# Enable directory listing #}
|
||||
autoindex_exact_size off; {# Display sizes in a human-readable format #}
|
||||
autoindex_localtime on; {# Show local time #}
|
||||
}
|
||||
|
||||
location /.well-known/ {
|
||||
alias {{nginx.directories.well_known}};
|
||||
allow all;
|
||||
default_type "text/plain";
|
||||
autoindex on;
|
||||
}
|
||||
}
|
1
roles/nginx-serve-files/vars/main.yml
Normal file
1
roles/nginx-serve-files/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
||||
application_id: "file_server"
|
Reference in New Issue
Block a user