|
本帖最后由 疯狂IT 于 2023-8-27 03:25 编辑
UUID在线生成:https://1024tools.com/uuid
1、安装宝塔:
安装nginx
安装完宝塔后进入后面直接一键安装即可(一键安装lnmp环境即可)
安装v2ray
宝塔和nginx完成以后,回到vps SSH窗口,执行命令
- bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
复制代码
执行完后,回到宝塔面板,左侧文件,依次打开,编辑
/usr/local/etc/v2ray/config.json
打开该文件,清空后粘贴如下代码
- {
- "log": {
- "loglevel": "info",
- "access": "/var/log/v2ray/access.log",
- "error": "/var/log/v2ray/error.log"
- },
- "inbounds": [
- {
- "port": 10001,
- "listen":"127.0.0.1",
- "protocol": "vmess",
- "settings": {
- "clients": [
- {
- "id": "5870aee3-64a9-444a-8c29-1f888913c37a",
- "alterId": 64
- }
- ]
- },
- "streamSettings": {
- "network": "ws",
- "wsSettings": {
- "path": "/happy"
- }
- }
- }
- ],
- "outbounds": [
- {
- "protocol": "freedom",
- "settings": {}
- }
- ]
- }
复制代码
配置网站
在宝塔后台新建一个站点,域名那里填入v2ray需要的那个域名,需提前购买。
站点创建好后,在SSL那里申请免费的SSL证书
然后点击配置文件,在配置文件最顶部添加以下代码
- # 定义变量
- map $http_upgrade $connection_upgrade {
- default upgrade;
- '' close;
- }
复制代码
然后大概这个位置(如下图)添加以下代码
- #v2配置文件
- location /happy {
- proxy_pass http://127.0.0.1:10000;
- proxy_redirect off;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $http_host;
- }
复制代码 然后大概这个位置(如下图)添加以下代码
回到vps SSH窗口
启动v2ray
设置开机自启
【推荐】安装 bbrplus 加速
centos代码如下
- wget -N --no-check-certificate "https://raw.githubusercontent.com/dlxg/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
复制代码
安装完BBR后可以优化配置后启用。
宝塔-安全-开放这个端口
|
|