Notes
Search…
v2ray

v2ray

安装

1
bash <(curl -L -s https://install.direct/go.sh)
2
3
statemctl enable v2ray
4
systemctl start v2ray
5
systemctl status v2ray
Copied!

配置

cat /etc/v2ray/config.json
1
{
2
"inbounds": [{
3
"port": XXX,
4
"listen": "127.0.0.1",
5
"protocol": "vmess",
6
"settings": {
7
"clients": [
8
{
9
"id": "XXX",
10
"alterId": 64
11
}
12
]
13
},
14
"streamSettings": {
15
"network": "ws",
16
"wsSettings": {
17
"path": "/XXX"
18
}
19
}
20
}],
21
"outbounds": [{
22
"protocol": "freedom",
23
"settings": {}
24
}]
25
}
Copied!

证书

1
yum -y install epel-release
2
yum -y install certbot
3
certbot certonly --standalone -d XXX
Copied!

nginx

安装

1
yum install -y nginx
2
systemctl enable nginx
3
systemctl start nginx
4
systemctl status nginx
Copied!

配置

cat /etc/nginx/conf.d/v2ray.conf
1
server {
2
listen 443 ssl;
3
server_name XXX;
4
5
ssl_certificate /etc/letsencrypt/live/XXX/fullchain.pem;
6
ssl_certificate_key /etc/letsencrypt/live/XXX/privkey.pem;
7
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
8
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
9
ssl_prefer_server_ciphers on;
10
ssl_session_cache shared:SSL:10m;
11
ssl_session_timeout 10m;
12
error_page 497 https://$host$request_uri;
13
14
location /tian {
15
proxy_pass http://127.0.0.1:XXX;
16
proxy_redirect off;
17
proxy_http_version 1.1;
18
proxy_set_header Upgrade $http_upgrade;
19
proxy_set_header Connection "upgrade";
20
proxy_set_header Host $http_host;
21
}
22
}
Copied!
Last modified 1yr ago