mirror of
https://github.com/XTLS/Xray-examples.git
synced 2024-11-22 00:21:29 +00:00
add VLESS-WSS-Nginx
This commit is contained in:
parent
3ac35a0062
commit
d9089dc6f1
66
VLESS+WSS+Nginx/client.json
Normal file
66
VLESS+WSS+Nginx/client.json
Normal file
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"log": {},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": "1080",
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": "1081",
|
||||
"protocol": "http",
|
||||
"settings": {}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "xx.com",
|
||||
"port": 443,
|
||||
"users": [
|
||||
{
|
||||
"id": "", //填写你的 UUID
|
||||
"encryption": "none"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"security": "tls",
|
||||
"wsSettings": {
|
||||
"path": "?ed=2048" //?ed=2048 前面填写你的 path
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
},
|
||||
{
|
||||
"tag": "blocked",
|
||||
"protocol": "blackhole",
|
||||
"settings": {}
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "IPOnDemand",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"geoip:private"
|
||||
],
|
||||
"outboundTag": "direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
27
VLESS+WSS+Nginx/nginx.conf
Normal file
27
VLESS+WSS+Nginx/nginx.conf
Normal file
|
@ -0,0 +1,27 @@
|
|||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name example.com;
|
||||
|
||||
index index.html;
|
||||
root /var/www/html;
|
||||
|
||||
ssl_certificate /path/to/example.cer;
|
||||
ssl_certificate_key /path/to/example.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
||||
|
||||
# 在 location 后填写 /你的 path
|
||||
location /你的 path {
|
||||
if ($http_upgrade != "websocket") {
|
||||
return 404;
|
||||
}
|
||||
proxy_pass http://unix:/dev/shm/Xray-VLESS-WSS-Nginx.socket;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 52w;
|
||||
}
|
||||
}
|
49
VLESS+WSS+Nginx/server.json
Normal file
49
VLESS+WSS+Nginx/server.json
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"listen": "/dev/shm/Xray-VLESS-WSS-Nginx.socket,0666",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "" // 填写你的 UUID
|
||||
}
|
||||
],
|
||||
"decryption": "none"
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"wsSettings": {
|
||||
"path": "" // 填写你的 path
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
},
|
||||
{
|
||||
"tag": "blocked",
|
||||
"protocol": "blackhole",
|
||||
"settings": {}
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "AsIs",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"geoip:private"
|
||||
],
|
||||
"outboundTag": "blocked"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue