diff --git a/src/nginxconfig/generators/conf/nginx.conf.js b/src/nginxconfig/generators/conf/nginx.conf.js index cb250b7..b0b08b9 100644 --- a/src/nginxconfig/generators/conf/nginx.conf.js +++ b/src/nginxconfig/generators/conf/nginx.conf.js @@ -111,9 +111,24 @@ export default (domains, global) => { || global.https.ocspGoogle.computed || global.https.ocspOpenDns.computed) { const ips = []; - if (global.https.ocspCloudflare.computed) ips.push('1.1.1.1', '1.0.0.1'); - if (global.https.ocspGoogle.computed) ips.push('8.8.8.8', '8.8.4.4'); - if (global.https.ocspOpenDns.computed) ips.push('208.67.222.222', '208.67.220.220'); + if (global.https.ocspCloudflare.computed) { + if (['ipv4', 'both'].includes(global.https.ocspCloudflareType.computed)) + ips.push('1.1.1.1', '1.0.0.1'); + if (['ipv6', 'both'].includes(global.https.ocspCloudflareType.computed)) + ips.push('[2606:4700:4700::1111]', '[2606:4700:4700::1001]'); + } + if (global.https.ocspGoogle.computed) { + if (['ipv4', 'both'].includes(global.https.ocspGoogleType.computed)) + ips.push('8.8.8.8', '8.8.4.4'); + if (['ipv6', 'both'].includes(global.https.ocspGoogleType.computed)) + ips.push('[2001:4860:4860::8888]', '[2001:4860:4860::8844]'); + } + if (global.https.ocspOpenDns.computed) { + if (['ipv4', 'both'].includes(global.https.ocspOpenDnsType.computed)) + ips.push('208.67.222.222', '208.67.220.220'); + if (['ipv6', 'both'].includes(global.https.ocspOpenDnsType.computed)) + ips.push('[2620:119:35::35]', '[2620:119:53::53]'); + } config.http.push(['resolver', `${ips.join(' ')} valid=60s`]); config.http.push(['resolver_timeout', '2s']); diff --git a/src/nginxconfig/i18n/en/templates/global_sections/https.js b/src/nginxconfig/i18n/en/templates/global_sections/https.js index 12b349e..6b3f483 100644 --- a/src/nginxconfig/i18n/en/templates/global_sections/https.js +++ b/src/nginxconfig/i18n/en/templates/global_sections/https.js @@ -17,6 +17,8 @@ limitations under the License. import common from '../../common'; const mozilla = 'Mozilla'; +const ipv4 = 'IPv4'; +const ipv6 = 'IPv6'; export default { sslProfile: `${common.ssl} Profile`, @@ -29,4 +31,7 @@ export default { mozillaModern: `${mozilla} Modern`, mozillaIntermediate: `${mozilla} Intermediate`, mozillaOld: `${mozilla} Old`, + ipv4Only: `${ipv4} only`, + ipv6Only: `${ipv6} only`, + ipv4AndIpv6: `${ipv4} & ${ipv6}`, }; diff --git a/src/nginxconfig/scss/_fields.scss b/src/nginxconfig/scss/_fields.scss index 49c4d52..e102daa 100644 --- a/src/nginxconfig/scss/_fields.scss +++ b/src/nginxconfig/scss/_fields.scss @@ -39,6 +39,10 @@ limitations under the License. &.is-aligned-top { align-items: flex-start; } + + + .control { + margin-top: .5rem; + } } &.is-grouped { diff --git a/src/nginxconfig/templates/global_sections/https.vue b/src/nginxconfig/templates/global_sections/https.vue index 75100d8..c96058e 100644 --- a/src/nginxconfig/templates/global_sections/https.vue +++ b/src/nginxconfig/templates/global_sections/https.vue @@ -68,6 +68,19 @@ limitations under the License. +
+