nginx+vless+ws+tls(+cloudflare) 2022-04 更新
前言: 是时候更新下了,之前的Vmess再装已经不适用了。这次主要是配合前面有一篇内网穿透+NGINX 做国内无80 443 的 网页转发的,用Cloudflare可以省掉CN2节点的流量。
2022/05/01 补充:我又多装了几次,终于发现之前的问题所在了。之前一直是SSRPLUS可以用,Passwall不能用,配置都是手打的,有一个没让我注意到的点Passwall配置的时候 tls下的alpn是要填http/1.1 不然会出现malformed http response
这样子之前的vmess的搭建步骤还是有效的。属实是愚钝了。
这次又需要ws+tls,就再记录下。这次用vless了,vmess一直不成功,应该是版本的原因。
0. 简单的步骤
0.1 可能更改VPS系统时间
- rm -rf /etc/localtime
- ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
0.2 安装下lnmp,参考lnmp.org。需要BBR也就装下。
1. 安装v2ray:https://github.com/v2fly/fhs-install-v2ray
2. 用whereis v2ray 查看配置文件地址,因为他们也喜欢换来换去。
3. vi config.json 修改下配置文件
4. v2ray相关命令
service v2ray restart
service v2ray status
systemctl start v2ray
systemctl status v2ray
systemctl enable v2ray #开启启动
5. Nginx配置
- location /5e60be4f39c63c/ {
- if ($http_upgrade != "websocket") {
- return 404;
- }
- proxy_redirect off;
- proxy_pass http://127.0.0.1:65432;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $host;
- # Show real IP in v2ray access.log
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
6. SSL配置下 Cloudflare IP优选
https://github.com/XIU2/CloudflareSpeedTest/releases
7.可能有其它问题,也写在Blog里了。
Comments
Post a Comment