server {
    listen 80;
    listen [::]:80;
    server_name {{ domain }} www.{{ domain }};
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name {{ domain }} www.{{ domain }};
    location ~ /.well-known/ {
        allow all;
        root /var/www/html;
    }
    ssl_certificate /etc/letsencrypt/live/{{ domain }}/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/{{ domain }}/privkey.pem;
    location / {
        proxy_pass  http://docksible_{{ service_to_encrypt }}:{{ internal_http_port }};
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
    # TODO: Restore these parameters.
    client_max_body_size 5m;
    client_body_buffer_size 16k;
}
