From 8acc9bbeaba6197c2ed810f3c578b08da7453f74 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:17:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E5=A2=9E=E5=8A=A0v?= =?UTF-8?q?less?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a8ae70b..345e3fe 100644 --- a/install.sh +++ b/install.sh @@ -292,8 +292,39 @@ installTLS(){ fi # nginxInstallLine=`cat /etc/nginx/nginx.conf|grep -n "}"|awk -F "[:]" 'END{print $1-1}'` # sed -i "${nginxInstallLine}i server {listen 443 ssl;server_name $1;root /usr/share/nginx/html;ssl_certificate /etc/nginx/$1.crt;ssl_certificate_key /etc/nginx/$1.key;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_prefer_server_ciphers on;location / {} location /alone { proxy_redirect off;proxy_pass http://127.0.0.1:31299;proxy_http_version 1.1;proxy_set_header Upgrade \$http_upgrade;proxy_set_header Connection "upgrade";proxy_set_header X-Real-IP \$remote_addr;proxy_set_header Host \$host;proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;}}" /etc/nginx/nginx.conf + # todo + cat << EOF > /etc/nginx/conf.d/alone.conf +server { + listen 443 ssl; + server_name $1; + root /usr/share/nginx/html; + ssl_certificate /etc/nginx/v2ray-agent-https/$1.crt;ssl_certificate_key /etc/nginx/v2ray-agent-https/$1.key; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_prefer_server_ciphers on; + location / {} + location /alone { + proxy_redirect off; + proxy_pass http://127.0.0.1:31299; + proxy_http_version 1.1; + proxy_set_header Upgrade \$http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Real-IP \$remote_addr; + proxy_set_header Host \$host; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + } + location /vless { + proxy_redirect off; + proxy_pass http://127.0.0.1:31298; + proxy_http_version 1.1; + proxy_set_header Upgrade \$http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Real-IP \$remote_addr; + proxy_set_header Host \$host; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + } +} +EOF - echo "server {listen 443 ssl;server_name $1;root /usr/share/nginx/html;ssl_certificate /etc/nginx/v2ray-agent-https/$1.crt;ssl_certificate_key /etc/nginx/v2ray-agent-https/$1.key;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_prefer_server_ciphers on;location / {} location /alone { proxy_redirect off;proxy_pass http://127.0.0.1:31299;proxy_http_version 1.1;proxy_set_header Upgrade \$http_upgrade;proxy_set_header Connection "upgrade";proxy_set_header X-Real-IP \$remote_addr;proxy_set_header Host \$host;proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;}}" > /etc/nginx/conf.d/alone.conf # 自定义路径 # todo 随机路径 @@ -551,6 +582,29 @@ initV2RayConfig(){ } } }, + { + "port":31298, + "protocol":"vless", + "settings":{ + "clients":[ + { + "id":"c95f22d4-5f7c-6248-8524-2bc830908ff9", + "alterId":64, + "level":1, + "email":"test@v2ray.com" + } + ], + "decryption": "none", + "fallback": {}, + "fallback_h2": {} + }, + "streamSettings":{ + "network":"ws", + "wsSettings":{ + "path":"/vld" + } + } + }, { "port":31294, "protocol":"vmess", @@ -664,6 +718,29 @@ EOF "path":"/alone" } } + }, + { + "port":31298, + "protocol":"vless", + "settings":{ + "clients":[ + { + "id":"c95f22d4-5f7c-6248-8524-2bc830908ff9", + "alterId":64, + "level":1, + "email":"test@v2ray.com" + } + ], + "decryption": "none", + "fallback": {}, + "fallback_h2": {} + }, + "streamSettings":{ + "network":"ws", + "wsSettings":{ + "path":"/vld" + } + } } ], "outbounds":[