From 4daadd054bcaddff2ac9260b6cebcd31edc95da4 Mon Sep 17 00:00:00 2001 From: Matthew Fennell Date: Fri, 2 Jan 2026 01:17:03 +0000 Subject: Enforce chat delegate prefix across all hosts I use the playbook to deploy to three different domains. Before this commit, some instances were deployed to the root domain (e.g. example.org) and others were deployed to a subdomain (e.g. chat.example.org), so that other services/hosts could easily live at the root. I would now like to enforce that all instances live under the chat. subdomain. There is no real benefit to having this difference in deployments, having more consistency will make reasoning about the different instances easier and allow me to delete some extra variables, and it will also allow me to deploy separate services to the root domains in the future if needed. --- files/nginx_conf.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'files/nginx_conf.j2') diff --git a/files/nginx_conf.j2 b/files/nginx_conf.j2 index ccdc630..3630f78 100644 --- a/files/nginx_conf.j2 +++ b/files/nginx_conf.j2 @@ -9,11 +9,11 @@ server { ssl_certificate /etc/prosody/certs/{{ virtual_host }}.crt; ssl_certificate_key /etc/prosody/certs/{{ virtual_host }}.key; - server_name {{ delegate_host }}; + server_name chat.{{ virtual_host }}; location / { proxy_pass https://localhost:5281; - proxy_set_header Host "{{ delegate_host }}"; + proxy_set_header Host "chat.{{ virtual_host }}"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; @@ -25,7 +25,7 @@ server { listen 80; listen [::]:80; - server_name {{ delegate_host }}; + server_name chat.{{ virtual_host }}; return 301 https://$host$request_uri; } -- cgit v1.2.3