宝塔面板与xui共存开启cdn教程

1. 安装宝塔面板

2. X-UI面板安装及配置

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

https://jihulab.com/images1/tp/-/raw/main/xraycdn/x1.png

3. 宝塔面板创建站点

https://jihulab.com/images1/tp/-/raw/main/xraycdn/x2.png

https://jihulab.com/images1/tp/-/raw/main/xraycdn/x3.png

# /spt2/是节点中设置的路径信息,做对应修改即可
location /spt2/ {
        proxy_redirect off;
        proxy_pass http://127.0.0.1:57715;# 57715是添加节点的端口号
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_read_timeout 300s;
        # Show realip in v2ray access.log
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

4. 节点添加和使用

经过上述设置后,节点已经可以通过在X-UI中扫码添加的方式进行使用,但是需要修改以下几个内容: