| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- # ============================================
- # Debug/Reference Configuration for V2Ray Paths
- # ============================================
- # This file shows the nginx location blocks for all V2Ray protocols.
- # The actual configuration is in vhost/default which is included by nginx-proxy.
- # ============================================
- # ============================================
- # VLESS WebSocket (Port 1310)
- # ============================================
- location /vless-ws {
- proxy_redirect off;
- proxy_pass http://v2ray:1310;
- proxy_http_version 1.1;
-
- # WebSocket upgrade headers (CRITICAL for WS to work)
- 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;
-
- # Long timeout for persistent connections
- proxy_read_timeout 86400s;
- proxy_send_timeout 86400s;
-
- # Disable buffering for real-time streaming
- proxy_buffering off;
- }
- # ============================================
- # VLESS gRPC (Port 1311)
- # ============================================
- location /vless-grpc {
- # Handle CORS preflight requests
- if ($request_method = 'OPTIONS') {
- return 200;
- }
-
- # gRPC proxy pass
- grpc_pass grpc://v2ray:1311;
-
- # Long timeout for gRPC streams
- 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 /vmess-ws {
- proxy_redirect off;
- proxy_pass http://v2ray:1312;
- proxy_http_version 1.1;
-
- # WebSocket upgrade headers (CRITICAL for WS to work)
- 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;
-
- # Long timeout for persistent connections
- proxy_read_timeout 86400s;
- proxy_send_timeout 86400s;
-
- # Disable buffering for real-time streaming
- proxy_buffering off;
- }
- # ============================================
- # Fallback - Return 404 for unmatched paths
- # ============================================
- location / {
- return 404;
- }
|