diff --git a/roles/mastodon/templates/mastodon.conf.j2 b/roles/mastodon/templates/mastodon.conf.j2 index 5bb2931..f813d81 100644 --- a/roles/mastodon/templates/mastodon.conf.j2 +++ b/roles/mastodon/templates/mastodon.conf.j2 @@ -6,7 +6,7 @@ map $http_upgrade $connection_upgrade { server { listen 80; listen [::]:80; - server_name {{ mastodon_host }}; + server_name {{ mastodon_host | default('{{ ansible_fqdn }}') }}; # Useful for Let's Encrypt location /.well-known/acme-challenge/ { allow all; } @@ -24,8 +24,8 @@ server { ssl_session_cache shared:SSL:10m; {% if disable_letsencrypt != "true" %} - ssl_certificate /etc/letsencrypt/live/{{ mastodon_host }}/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/{{ mastodon_host }}/privkey.pem; + ssl_certificate /etc/letsencrypt/live/{{ mastodon_host | default('{{ ansible_fqdn }}') }}/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/{{ mastodon_host | default('{{ ansible_fqdn }}') }}/privkey.pem; {% endif %} keepalive_timeout 70;