worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; {% for i in range(cookiecutter.ips|length) %} server { listen 443 ssl; server_name {{ ' '.join(cookiecutter.domains[i]) }}; ssl_certificate /usr/local/etc/letsencrypt/live/{{ cookiecutter.domains[i][0] }}/fullchain.pem; ssl_certificate_key /usr/local/etc/letsencrypt/live/{{ cookiecutter.domains[i][0] }}/privkey.pem; location / { proxy_pass http://{{ cookiecutter.ips[i] }}; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_request_buffering off; } } {% endfor %} }