| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- # ============================================
- # V2Ray Multi-Protocol Nginx Configuration
- # ============================================
- # This file is included by nginx-proxy for all vhosts
- # It configures the paths for VLESS-WS, VLESS-gRPC, and VMess-WS
- # ============================================
- # ============================================
- # VLESS WebSocket (Port 1310) - Root Path
- # ============================================
- location / {
- proxy_redirect off;
- proxy_pass http://v2ray:1310;
- proxy_http_version 1.1;
-
- # WebSocket upgrade headers
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
-
- # Required headers
- 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_set_header X-Forwarded-Proto $scheme;
-
- # Timeouts for long-running connections
- proxy_read_timeout 86400s;
- proxy_send_timeout 86400s;
-
- # Buffer settings
- proxy_buffering off;
- }
- # ============================================
- # VLESS gRPC (Port 1311)
- # ============================================
- location /grpc {
- # Handle CORS preflight
- if ($request_method = 'OPTIONS') {
- return 200;
- }
-
- # gRPC proxy
- grpc_pass grpc://v2ray:1311;
- grpc_read_timeout 86400s;
- grpc_send_timeout 86400s;
-
- # Required headers
- grpc_set_header Host $host;
- grpc_set_header X-Real-IP $remote_addr;
- grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- # ============================================
- # VMess WebSocket (Port 1312)
- # ============================================
- location /ws {
- proxy_redirect off;
- proxy_pass http://v2ray:1312;
- proxy_http_version 1.1;
-
- # WebSocket upgrade headers
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
-
- # Required headers
- 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_set_header X-Forwarded-Proto $scheme;
-
- # Timeouts for long-running connections
- proxy_read_timeout 86400s;
- proxy_send_timeout 86400s;
-
- # Buffer settings
- proxy_buffering off;
- }
|