diff --git a/backend/internal/nginx.js b/backend/internal/nginx.js index 66fd2109..9972d417 100644 --- a/backend/internal/nginx.js +++ b/backend/internal/nginx.js @@ -273,6 +273,7 @@ const internalNginx = { return new Promise((resolve, reject) => { let template = null; let filename = '/data/nginx/temp/letsencrypt_' + certificate.id + '.conf'; + try { template = fs.readFileSync(__dirname + '/../templates/letsencrypt-request.conf', {encoding: 'utf8'}); } catch (err) { @@ -280,6 +281,8 @@ const internalNginx = { return; } + certificate.ipv6 = internalNginx.ipv6Enabled(); + renderEngine .parseAndRender(template, certificate) .then((config_text) => { diff --git a/backend/templates/letsencrypt-request.conf b/backend/templates/letsencrypt-request.conf index 2adcdb32..cda2f892 100644 --- a/backend/templates/letsencrypt-request.conf +++ b/backend/templates/letsencrypt-request.conf @@ -2,6 +2,10 @@ server { listen 80; +{% if ipv6 -%} + listen [::]:80; +{% endif %} + server_name {{ domain_names | join: " " }}; access_log /data/logs/letsencrypt-requests.log standard;