{% for user in users %}
server {
    listen 443 ssl;
    listen [::]:443 ssl;

    ssl_certificate /etc/letsencrypt/live/{{ user.name }}.{{ hostname }}/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/{{ user.name }}.{{ hostname }}/privkey.pem;
    server_name {{ user.name }}.{{ hostname }};
    root /home/{{ user.name }}/public_html;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}
{% endfor %}
