From dad0355f8c42cb7ccb9a8e0843202e2391c01c89 Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Fri, 27 Nov 2026 10:07:07 +0100 Subject: [PATCH] hoekveen.net fix --- host_vars/akatosh.yml | 1 + playbook.yml | 1 + tasks/cloud_nginx/vhost.conf.j2 | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/host_vars/akatosh.yml b/host_vars/akatosh.yml index c946602..6359315 100644 --- a/host_vars/akatosh.yml +++ b/host_vars/akatosh.yml @@ -27,6 +27,7 @@ cloud_nginx_sites: port: 3496 - name: www server_name: www.hoekveen.net + aliases: [hoekveen.net] root: /opt/hoekveen.net - name: nightingale server_name: karaoke.hoekveen.net diff --git a/playbook.yml b/playbook.yml index 8ef94f2..b4c9f19 100644 --- a/playbook.yml +++ b/playbook.yml @@ -138,6 +138,7 @@ - import_tasks: tasks/fail2ban.yml tags: fail2ban - import_tasks: tasks/cloud_nginx.yml + tags: nginx - name: Ensure the backup user can run the forced-command pull user: name: backup diff --git a/tasks/cloud_nginx/vhost.conf.j2 b/tasks/cloud_nginx/vhost.conf.j2 index c7b6207..408feb2 100644 --- a/tasks/cloud_nginx/vhost.conf.j2 +++ b/tasks/cloud_nginx/vhost.conf.j2 @@ -1,9 +1,10 @@ # {{ ansible_managed }} +{% set server_names = ([item.server_name] + item.aliases | default([])) | join(' ') %} {% if cloud_nginx_tls | default(false) %} server { listen 80; listen [::]:80; - server_name {{ item.server_name }}; + server_name {{ server_names }}; # ACME http-01 renewals keep working over plain http location /.well-known/acme-challenge/ { root /var/www/letsencrypt; } location / { return 301 https://$host$request_uri; } @@ -21,7 +22,7 @@ server { listen 80; listen [::]:80; {% endif %} - server_name {{ item.server_name }}; + server_name {{ server_names }}; client_max_body_size {{ item.max_body | default('512m') }};