Skip to content

Instantly share code, notes, and snippets.

@Bonveio
Last active January 26, 2024 00:07
Show Gist options
  • Select an option

  • Save Bonveio/59e8b9561e20e8b612f65a3d47a97d13 to your computer and use it in GitHub Desktop.

Select an option

Save Bonveio/59e8b9561e20e8b612f65a3d47a97d13 to your computer and use it in GitHub Desktop.
Sample v2ray vmess + ws + tls setup
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbounds": [{
"port": 10035,
"listen": "127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "GENERATED_UUID_CODE",
"level": 1,
"alterId": 64
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"headers": {
"Host": "SERVER_DOMAIN"
},
"path": "/"
}
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}
server {
# Create a fake or rather link your site here just to disguise or hide v2ray server
listen 0.0.0.0:80;
server_name DOMAIN_HERE;
return 302 https://www.globe.com.ph;
}
server {
listen 0.0.0.0:443 ssl;
server_name DOMAIN_HERE;
ssl_certificate /usr/local/etc/v2ray/fullchain.pem;
ssl_certificate_key /usr/local/etc/v2ray/key.pem;
ssl_session_timeout 1d;
#ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
#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;
ssl_prefer_server_ciphers off;
# if you want to add or change WS path, change "location /" into "location /mypath"
location / {
if ($http_upgrade != "websocket") {
return 302 https://www.globe.com.ph;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:10035;
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment