阿华的记事本

  • 导航
    • 首页
    • 导航
    • 下载
    • 归档
  • 分类
    • 博客
    • 笔记
    • 摄影
    • 记事
  • 交流
    • 吹水
    • 图片
    • 关于
    • 留言
Hua's Note
阿华的记事
  1. 首页
  2. 记事本
  3. 正文

新服务器部署了科学上网,记录一下

2025年3月11日 46点热度 0人点赞 0条评论

1. 安装v2ray

# 下载安装脚本并执行wget https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.shbash install-release.sh

2. 配置v2ray

编辑配置文件 /usr/local/etc/v2ray/config.json,以下为WebSocket + TLS的推荐配置(需配合Nginx反向代理):

{
  "inbounds": [{
    "port": 10086,
    "protocol": "vmess",
    "settings": {
      "clients": [{
        "id": "自行生成的UUID",  // 使用`uuidgen`生成
        "alterId": 0
      }]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path": "/ray"  // 自定义路径,需与Nginx配置一致
      }
    }
  }],
  "outbounds": [{
    "protocol": "freedom"
  }]
}

3. 启动v2ray服务

systemctl enable v2ray

systemctl start v2ray

4. 配置Nginx反向代理(通过宝塔面板)

在宝塔面板中打开网站对应的Nginx配置,添加以下反向代理规则:

location /ray {  # 路径与v2ray配置中的`path`一致
  proxy_pass http://127.0.0.1:10086;  # 端口与v2ray配置一致
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
  proxy_set_header Host $host;
}

重启Nginx服务。

5.检查服务状态

  • 直接部署:systemctl status v2ray
  • Docker部署:docker ps | grep v2ray

6.客户端配置
使用v2ray客户端(如V2RayN、Qv2ray),填入服务器IP/域名、端口、UUID及路径(WebSocket需填写path)。

7.测试连通性
通过在线工具(如https://www.itdog.cn/tcping/)验证端口是否开放,或使用客户端连接测试。

标签: 暂无
最后更新:2025年3月11日

大笨钟

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

大笨钟

这个人很懒,什么都没留下

最新说说
  • 06-15 22:31 又到父亲节,思绪满天,忆起儿时事,甜蜜无...
  • 06-07 07:37 祝各位高考学子金榜题名
  • 04-23 15:19 今天(4月23日),是人民海军成立76周...
  • 04-20 11:23 今天试了一下DeepSeek+anyth...
  • 04-20 11:17 🌿谷雨,春的尾声,夏的序章 “清明断雪,...
分类
  • 小相册
  • 笔记本
  • 记事本
归档
  • 2025 年 6 月
  • 2025 年 3 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 11 月
  • 2024 年 10 月
  • 2024 年 9 月
  • 2024 年 8 月
  • 2024 年 3 月
  • 2023 年 12 月
  • 2023 年 11 月

COPYRIGHT © 2017-2025 阿华的记事本. ALL RIGHTS RESERVED.