Fix LE certs for IPv6 only domains Fixes 394

This commit is contained in:
Jamie Curnow 2020-05-20 22:21:26 +10:00
parent 8ab161a3ee
commit 2ebfdcf0c9
2 changed files with 7 additions and 0 deletions

View File

@ -273,6 +273,7 @@ const internalNginx = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let template = null; let template = null;
let filename = '/data/nginx/temp/letsencrypt_' + certificate.id + '.conf'; let filename = '/data/nginx/temp/letsencrypt_' + certificate.id + '.conf';
try { try {
template = fs.readFileSync(__dirname + '/../templates/letsencrypt-request.conf', {encoding: 'utf8'}); template = fs.readFileSync(__dirname + '/../templates/letsencrypt-request.conf', {encoding: 'utf8'});
} catch (err) { } catch (err) {
@ -280,6 +281,8 @@ const internalNginx = {
return; return;
} }
certificate.ipv6 = internalNginx.ipv6Enabled();
renderEngine renderEngine
.parseAndRender(template, certificate) .parseAndRender(template, certificate)
.then((config_text) => { .then((config_text) => {

View File

@ -2,6 +2,10 @@
server { server {
listen 80; listen 80;
{% if ipv6 -%}
listen [::]:80;
{% endif %}
server_name {{ domain_names | join: " " }}; server_name {{ domain_names | join: " " }};
access_log /data/logs/letsencrypt-requests.log standard; access_log /data/logs/letsencrypt-requests.log standard;