module.exports = function sslVhost (opts) {
  return `server {
  listen 80;
  server_name ${opts.domain};
  return 301 https://$host$request_uri;
}

server {
  listen 443 ssl http2;
  server_name ${opts.domain};
  root ${opts.sitesDir}/html/${opts.domain};

  ssl on;
  ssl_certificate ${opts.sitesDir}/certs/${opts.domain}/fullchain.pem;
  ssl_certificate_key ${opts.sitesDir}/certs/${opts.domain}/privkey.pem;
  ssl_session_timeout 5m;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  ssl_prefer_server_ciphers on;
  ssl_stapling on;
  ssl_stapling_verify on;
  ssl_trusted_certificate ${opts.sitesDir}/certs/${opts.domain}/ca.pem;

  ssl_session_cache shared:SSL:10m;
  ssl_dhparam /etc/ssl/certs/dhparam.pem;

  error_page 400 401 402 403 404 500 /404.html;

  location / {
    try_files $uri $uri/ $uri.html /200.html =404;
  }

  location /404.html {
    try_files /404.html @error;
    internal;
  }

  location @error {
    root /home/ubuntu/staticland-api/html;
  }
}`
}

@@ -249,16 +249,45 @@
 domain%7D;
+%0A  client_max_body_size 100M;
 %0A%0A  ssl 
@@ -308,38 +308,37 @@
 ificate 
-$%7Bopts.sitesDir%7D/certs
+/etc/letsencrypt/live
 /$%7Bopts.
@@ -382,38 +382,113 @@
 ate_key 
-$%7Bopts.sitesDir%7D/certs
+/etc/letsencrypt/live/$%7Bopts.domain%7D/privkey.pem;%0A  ssl_trusted_certificate /etc/letsencrypt/live
 /$%7Bopts.
@@ -491,37 +491,40 @@
 pts.domain%7D/
-privkey
+fullchain
 .pem;%0A
+%0A
   ssl_sessio
@@ -641,16 +641,44 @@
 6+EDH';%0A
+  ssl_ecdh_curve secp384r1;%0A
   ssl_pr
@@ -756,151 +756,225 @@
 ssl_
-trusted_certificate $%7Bopts.sitesDir%7D/certs/$%7Bopts.domain%7D/ca.pem;%0A%0A  ssl_session_cache shared:SSL:10m;%0A  ssl_dhparam /etc/ssl/certs/dhparam.pem
+session_cache shared:SSL:10m;%0A  ssl_dhparam /etc/ssl/certs/dhparam.pem;%0A%0A  add_header Strict-Transport-Security %22max-age=15768000%22 always;%0A  add_header X-Frame-Options DENY;%0A  add_header X-Content-Type-Options nosniff
 ;%0A%0A 

rewrite ssl vhost template