- mkdir -p /root/scripts/shell && \
- wget -O /root/scripts/shell/v2ray-install-release.sh https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh && \
- chmod +x /root/scripts/shell/v2ray-install-release.sh && \
- wget -O /root/scripts/shell/v2ray-install-dat-release.sh https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh && \
- chmod +x /root/scripts/shell/v2ray-install-dat-release.sh && \
- /root/scripts/shell/v2ray-install-release.sh && \
- /root/scripts/shell/v2ray-install-dat-release.sh
复制代码
- cat << "EOF" > /usr/local/etc/v2ray/config.json
- {
- "inbounds": [
- {
- "listen": "0.0.0.0",
- "port": 1080,
- "protocol": "vmess",
- "settings":
- {
- "clients": [
- {
- "alterId": 64,
- "id": "d4f7ac9c-95bb-1111-1111-111111111111"
- }]
- },
- "streamSettings":
- {
- "network": "tcp",
- "security": "none",
- "tcpSettings":
- {
- "type": "none"
- }
- },
- "tag": "",
- "sniffing":
- {
- "enabled": true,
- "destOverride": ["http", "tls"]
- }
- },
- {
- "listen": "127.0.0.1",
- "port": 12345,
- "protocol": "vmess",
- "settings":
- {
- "clients": [
- {
- "alterId": 64,
- "id": "d4f7ac9c-95bb-1111-1111-111111111111"
- }]
- },
- "streamSettings":
- {
- "network": "ws",
- "wsSettings":
- {
- "path": "/websocket"
- }
- }
- }],
- "outbounds": [
- {
- "protocol": "freedom",
- "settings":
- {}
- }]
- }
- EOF
- systemctl enable v2ray; systemctl start v2ray; systemctl status v2ray
复制代码
- server {
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- server_name .........;
- root ....;
- index index.htm index.html index.php;
-
- ......
- location /websocket {
- proxy_redirect off;
- proxy_pass http://127.0.0.1:12345;
- proxy_http_version 1.1;
- proxy_intercept_errors on;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $http_host;
- }
- ......
- }
复制代码
|