个人用的配置,直接装Nginx,然后用v2ray的一键脚本(v2ray.com) ws+tls的配置参考Nginx: server { listen 80; listen 443 ssl http2; error_page 400 = error.htmll; #自行修改400页面 server_name example.com; #自行修改域名 index index.html index.htm index.php; root /var/www/html; ssl on; ssl_certificate /etc/letsencrypt/live/example.com/cert.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; #自行修改RSA KEY ssl_session_timeout 10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache builtin:1000 shared:SSL:10m; ssl_buffer_size 1400; add_header Strict-Transport-Security max-age=15768000; ssl_stapling on; ssl_stapling_verify on; #error_page 404 /404.html; #error_page 502 /502.html; location / { root “/var/www/html/”; autoindex on; autoindex_exact_size off; autoindex_localtime on; } location /v2ray/ { #你的v2ray websocket地址 proxy_redirect off; proxy_pass http://127.0.0.1:419; #自行修改地址,和v2ray config里的对应就行 proxy_http_version 1.1; #另,若使用http://1.2.3.4:1234这样的,直接到其他节点了,请多配一个location和不同的目录地址用作区分 proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection “upgrade”; proxy_set_header Host $http_host; } } v2ray: { “log” : { “access”: “/var/log/v2ray-access.log”, “error”: “/var/log/v2ray-error.log”, “loglevel”: “warning” }, “inbound”:{ #websocket地址,端口和上面的对应就行,可自行修改 “port”: 419, “listen”: “127.0.0.1”, “protocol”: “vmess”, “allocate”: { “strategy”: “always” }, “settings”: { “udp”: true, “clients”: [ { “id”: “”, #uuid,自行生成,此处已空 “alterId”: 8, #额外id,自己喜好 “level”: 1 } ] }, “streamSettings”: { “network”: “ws”, “security”: “auto”, “wsSettings”: { “connectionReuse”: true, “path”: “/v2ray/” #你的websocket地址,自行修改至和Nginx一致 } } }, “outbound”: { “protocol”: “freedom”, “settings”: {} } } |