- Nginx(反代) + Websocket + SSL 方案
- Caddy + tls + h2 + 阿里CDN 🚫 CDN不支持回源h2(Caddy日志记录为http1.1 遂失败) / 国内CDN需要备案域名 / Nginx不支持h2反代 / 速度不理想
- mKcp方案 🚫 端口封杀太快甚至直接封IP
- Websocket + CDN CloudFlare的试过了,速度很不理想 / 阿里云全站、又拍云 WSCDN 加速基本 ¥4/GB 还要另算 CDN 加速费
- AWS 信用卡可以可以撸免费额度,选日本节点,所谓的 Global 加速也没有很理想
- GCP 谷歌云 这个可以作为备选,台湾节点理想,要注意的是,访问谷歌云需要梯子
- 阿里云 轻量服务器为首选,新加坡节点比较理想
- Azure 还没尝试,感觉大同小异,不折腾这个了
- ipip.net router trace
- 国际出口线路海底就那几条,所以高峰时期会慢是没办法的
- CentOS 7 x64 or whatever Ubuntu
- 一台国际服务器,并允许SSH连接
- 开启80 443端口
- 域名
- 域名对应 SSL 证书
- 新建目录
/etc/v2ray
- 安装nginx并设置开机启动
sudo apt update
- 注意证书的配置
vi /etc/ssh/sshd_config
PermitRootLogin yes //默认为no,需要开启root用户访问改为yes
PasswordAuthentication yes //默认为no,改为yes开启密码登陆
service sshd restart # 重启 SSH 服务
sudo apt install nginx # 安装
sudo systemctl enable nginx # 设置开机启动
sudo systemctl start nginx
sudo apt install cerbot python3-certbot-nginx
sudo certbot --nginx
https://github.com/v2fly/fhs-install-v2ray
$ wget https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
$ sudo bash install-release.sh
See the other file.
sudo vim /usr/local/etc/v2ray/config.json
sudo systemctl enable v2ray # 设置开机启动
sudo systemctl start v2ray
Enable server
domain first.
vim /var/log/nginx/error.log
systemctl status nginx.service -l
-
客户端提示 502 Bad Gateway > websocket: bad handshake
-
从nginx入手 查看日志
-
权限不足,选择关闭SELinux
-
查看
/usr/sbin/sestatus -v
-
修改
/etc/selinux/config
文件将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
-
-
connect() failed (111: Connection refused) while connecting to upstream
- v2ray 未启动成功
*521 connect() to 127.0.0.1:666 failed (13: Permission denied) while connecting to upstream, client: 218.85.120.242, server: brazil.emin.ink, request: "GET /emin HTTP/1.1", upstream: "http://127.0.0.1:666/emin", host: "brazil.emin.ink"
- https://juejin.im/entry/6844903669830254600
- https://wiki.crowncloud.net/?How_to_enable_BBR_on_Ubuntu_20_04
Verify current algos:
$ sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic
$ sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = cubic
Update $ sudo vim /etc/sysctl.conf
and append the two lines at the end:
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
Execute and verify:
$ sudo sysctl -p
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
$ sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = bbr