From d52a4a2bbe4b7429caf21d03d4b698e95d4dbc90 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 17 Nov 2024 17:12:40 +0700 Subject: [PATCH] Remove HTTP/2 --- src/executor/nginx.js | 8 +------- src/executor/runnersub.js | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/executor/nginx.js b/src/executor/nginx.js index 9c27002..c89299f 100644 --- a/src/executor/nginx.js +++ b/src/executor/nginx.js @@ -157,15 +157,11 @@ class NginxExecutor { if (sslconf !== "off") { node._add('listen', info.ip ? info.ip + ":443 ssl" : "443 ssl"); node._add('listen', (info.ip6 || '[::]') + ":443 ssl"); - if (httpconf == 2) { - node._add('http2', "on"); - } if (httpconf == 3) { node._add('listen', info.ip ? info.ip + ":443 quic" : "443 quic"); node._add('listen', (info.ip6 || '[::]') + ":443 quic"); - node._add('http2', "on"); node._add('http3', "on"); - node._add('add_header', `Alt-Svc 'h3=":443"; ma=86400, h3-29=":443"'`); + node._add('add_header', `Alt-Svc 'h3=":443"; ma=86400'`); } } { node._add('root', info.root); @@ -363,8 +359,6 @@ class NginxExecutor { }); if (node.http3?.[0]._value == "on") { data.http = 3; - } else if (node.http2?.[0]._value == "on") { - data.http = 2; } let servernames = (node.server_name[0]?._value || '').split(' '); let hasApex = servernames.includes(domain); diff --git a/src/executor/runnersub.js b/src/executor/runnersub.js index 5ec1a98..31cd671 100644 --- a/src/executor/runnersub.js +++ b/src/executor/runnersub.js @@ -212,8 +212,8 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, var nginxNodes = await nginxExec.get(subdomain); var nginxInfos = nginxExec.extractInfo(nginxNodes, subdomain); value = parseInt(value); - if (![1, 2, 3].includes(value)) { - throw new Error(`http option invalid. specify "http 1", "http 2" or "http 3"`); + if (![1, 3].includes(value)) { + throw new Error(`http option invalid. specify "http 1" or "http 3"`); } if (value === nginxInfos.http) { await writeLog("$> http version config is set unchanged");