Nginx variable refactoring and general bug solving. Got interupted commit not tested

This commit is contained in:
2025-01-31 13:14:07 +01:00
parent b96d95f3e4
commit 11752f5e2e
23 changed files with 59 additions and 48 deletions

View File

@@ -11,7 +11,7 @@ This Ansible role configures an Nginx server to serve a static homepage. It hand
## Role Variables
- `nginx_homepage_root`: The directory where the homepage content will be stored (default: `/usr/share/nginx/homepage`)
- `nginx.directories.homepage`: The directory where the homepage content will be stored (default: `/usr/share/nginx/homepage`)
- `domain`: The domain name for the Nginx server configuration
- `administrator_email`: The email used for SSL certificate registration with Let's Encrypt
- `nginx_static_repository_address`: The Git repository address containing the homepage content

View File

@@ -2,14 +2,14 @@
- name: "pull homepage from {{nginx_static_repository_address}}"
git:
repo: "{{nginx_static_repository_address}}"
dest: "{{nginx_homepage_root}}"
dest: "{{nginx.directories.homepage}}"
update: yes
ignore_errors: true
- name: configure {{primary_domain}}.conf
template:
src: "static.nginx.conf.j2"
dest: "{{nginx_servers_directory}}{{primary_domain}}.conf"
dest: "{{nginx.directories.http.servers}}{{primary_domain}}.conf"
vars:
domain: "{{primary_domain}}"
notify: restart nginx

View File

@@ -13,12 +13,12 @@ server
location /
{
root {{nginx_homepage_root}};
root {{nginx.directories.homepage}};
index index.html index.htm;
}
location /.well-known/ {
alias {{nginx_well_known_root}};
alias {{nginx.directories.well_known}};
allow all;
default_type "text/plain";
autoindex on;