您现在的位置是:首页 > 科技动态科技动态

使用X-UI面板一键安装脚本搭建v2ray节点

查看 cc博主 的更多文章cc博主2023-02-06【科技动态】13822人已围观

  有各路大神实现的X-UI面板一键安装脚本,一定程度上降低了搭建v2ray节点的难度。

  使用面板来搭建,好处在于:由于拥有UI界面,信息展示相当直观,更便于我们新手操作(无需命令行)。项目地址:https://github.com/mlldxe/X-UI

  需准备

  VPS

  domain

  Cloudfare Account

  开始搭建

  使用Github进入X-UI官方仓库:https://github.com/vaxilu/x-ui

  复制官方推荐的脚本:

  bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)

  将面板原版升级至本优化版:

  wget -N --no-check-certificate https://raw.githubusercontent.com/taffychan/x-ui-3/main/install.sh && bash install.sh

  提示未安装curl工具,请先安装curl工具

  apt-get update

  apt-get upgrade

  apt-get install curl

  XUI5

  添加完成后,我们打开新的网页,在网址输入栏内输入你的域名:端口(mlldxe.ss-v2ray.xyz:2096),回车后即可进入到我们的登录界面。

  XUI6

  XUI7

  CDN套用

  如果需要支持CDN套用,还需要申请一套SSL证书。这一套证书实际上是用于你的子域名的认证的,请不要与主域名的证书混淆!使用的申请模式为DNS API模式,简单来说就是利用你域名的nameserver商提供的API完成证书签发,使用这种模式不依赖于端口开放等,成功率目前来看是最高的。

  1.添加A记录:

  XUI1

  2.设置Cloudflare API:

  XUI2

  XUI3

  XUI4

  直接使用整个脚本即可,具体使用方式如下:

  bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/BashScripts/main/SSLAutoInstall/SSLAutoInstall.sh)

  面板套用CDN

  除了我们搭建的节点可以套用CDN,我们的X-UI面板也支持套用CDN。如果需要X-UI面板也套用CDN,我们需要在面板内修改面板监听的端口为Cloudflare支持的端口,同时设置SSL证书密钥路径。在这里需要注意,面板的监听端口一定不要与你的节点共用同一端口。

  XUI8

  XUI9

  设置节点

  进入面板界面,添加入站节点,设置如下:

  XUI10

  XUI11

  域名:v2.mlldxe.cn 公钥路径:/etc/cert/cert.crt

  密钥路径:/etc/cert/private.key

  域名:xui.mlldxe.cn 公钥路径:/etc/cert/cert.crt

  密钥路径:/etc/cert/private.key

  vmess+ws+tls+cdn

  启用:开

  协议:vmess

  端口:443

  禁用不安全加密:关

  传输协议:ws

  acceptProxyProtocol:关

  路径:/temp

  请求头:名称:Host 值:v2.mlldxe.cn

  tls:开

  域名:v2.mlldxe.cn

  alpn:http/1.1

  公钥文件路径:/etc/cert/cert.crt

  私钥文件路径:/etc/cert/private.key

  sniffing:开

  最新:搭建---bulianglin

  https://bulianglin.com/

  #更新软件源

  apt update

  #启用 BBR TCP 拥塞控制算法

  echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf

  echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

  sysctl -p

  #安装x-ui:

  #原版

  bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)

  #优化魔改版

  wget -N --no-check-certificate https://raw.githubusercontent.com/taffychan/x-ui-3/main/install.sh && bash install.sh

  #安装nginx

  apt install nginx

  #安装acme:

  curl https://get.acme.sh | sh

  #添加软链接:

  ln -s /root/.acme.sh/acme.sh /usr/local/bin/acme.sh

  #切换CA机构:

  acme.sh --set-default-ca --server letsencrypt

  #申请证书:

  acme.sh --issue -d 你的域名 -k ec-256 --webroot /var/www/html

  #安装证书:

  acme.sh --install-cert -d 你的域名 --ecc --key-file /etc/x-ui/server.key --fullchain-file /etc/x-ui/server.crt --reloadcmd "systemctl force-reload nginx"

  寻找适合的伪装站

  http站点优先,个人网盘符合单节点大流量特征

  示例关键字:intext:登录 Cloudreve

  配置nginx

  配置文件路径:/etc/nginx/nginx.conf

  user www-data;

  worker_processes auto;

  pid /run/nginx.pid;

  include /etc/nginx/modules-enabled/*.conf;

  events {

  worker_connections 1024;

  }

  http {

  sendfile on;

  tcp_nopush on;

  tcp_nodelay on;

  keepalive_timeout 65;

  types_hash_max_size 2048;

  include /etc/nginx/mime.types;

  default_type application/octet-stream;

  gzip on;

  server {

  listen 8443 ssl;

  listen 2096 ssl;

  listen 443 ssl;

  listen 8080 ssl;

  listen 80 ssl;

  server_name xui.mlldxes.xyz; #你的域名

  ssl_certificate /etc/x-ui/server.crt; #证书位置

  ssl_certificate_key /etc/x-ui/server.key; #私钥位置

  ssl_session_timeout 1d;

  ssl_session_cache shared:MozSSL:10m;

  ssl_session_tickets off;

  ssl_protocols TLSv1.2 TLSv1.1;

  ssl_prefer_server_ciphers off;

  location / {

  proxy_pass https://www.hao123.com/; #伪装网址

  proxy_redirect off;

  proxy_ssl_server_name on;

  sub_filter_once off;

  sub_filter "www.hao123.com" $server_name; #伪装网址

  proxy_set_header Host "www.hao123.com"; #伪装网址

  proxy_set_header Referer $http_referer;

  proxy_set_header X-Real-IP $remote_addr;

  proxy_set_header User-Agent $http_user_agent;

  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  proxy_set_header X-Forwarded-Proto https;

  proxy_set_header Accept-Encoding "";

  proxy_set_header Accept-Language "zh-CN";

  }

  location /mlldxe { #分流路径

  proxy_redirect off;

  proxy_pass http://127.0.0.1:22911; #Xray端口

  proxy_http_version 1.1;

  proxy_set_header Upgrade $http_upgrade;

  proxy_set_header Connection "upgrade";

  proxy_set_header Host $host;

  proxy_set_header X-Real-IP $remote_addr;

  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  }

  location /xui { #xui路径

  proxy_redirect off;

  proxy_pass http://127.0.0.1:54321; #xui监听端口

  proxy_http_version 1.1;

  proxy_set_header Host $host;

  }

  }

  server {

  listen 80;

  listen 443;

  location /.well-known/ {

  root /var/www/html;

  }

  location / {

  rewrite ^(.*)$ https://$host$1 permanent;

  }

  }

  }

  每次修改nginx配置文件后必须使用 systemctl reload nginx 命令重新加载配置文件

  多用户

  通过修改nginx的配置文件实现ws path路径分流

  location /ray { #分流路径

  proxy_redirect off;

  proxy_pass http://127.0.0.1:10000; #Xray端口

  proxy_http_version 1.1;

  proxy_set_header Upgrade $http_upgrade;

  proxy_set_header Connection "upgrade";

  proxy_set_header Host $host;

  proxy_set_header X-Real-IP $remote_addr;

  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  }

Tags:

文章评论

   有免费节点资源,我们会通知你!  加入纸飞机订阅群  

×
天气预报查看日历分享网页电报扫码留言评论电报频道链接