debug-location.conf 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # ============================================
  2. # Debug/Reference Configuration for V2Ray Paths
  3. # ============================================
  4. # This file shows the nginx location blocks for all V2Ray protocols.
  5. # The actual configuration is in vhost/default which is included by nginx-proxy.
  6. # ============================================
  7. # ============================================
  8. # VLESS WebSocket (Port 1310)
  9. # ============================================
  10. location /vless-ws {
  11. proxy_redirect off;
  12. proxy_pass http://v2ray:1310;
  13. proxy_http_version 1.1;
  14. # WebSocket upgrade headers (CRITICAL for WS to work)
  15. proxy_set_header Upgrade $http_upgrade;
  16. proxy_set_header Connection "upgrade";
  17. # Required headers
  18. proxy_set_header Host $host;
  19. proxy_set_header X-Real-IP $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. proxy_set_header X-Forwarded-Proto $scheme;
  22. # Long timeout for persistent connections
  23. proxy_read_timeout 86400s;
  24. proxy_send_timeout 86400s;
  25. # Disable buffering for real-time streaming
  26. proxy_buffering off;
  27. }
  28. # ============================================
  29. # VLESS gRPC (Port 1311)
  30. # ============================================
  31. location /vless-grpc {
  32. # Handle CORS preflight requests
  33. if ($request_method = 'OPTIONS') {
  34. return 200;
  35. }
  36. # gRPC proxy pass
  37. grpc_pass grpc://v2ray:1311;
  38. # Long timeout for gRPC streams
  39. grpc_read_timeout 86400s;
  40. grpc_send_timeout 86400s;
  41. # Required headers
  42. grpc_set_header Host $host;
  43. grpc_set_header X-Real-IP $remote_addr;
  44. grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  45. }
  46. # ============================================
  47. # VMess WebSocket (Port 1312)
  48. # ============================================
  49. location /vmess-ws {
  50. proxy_redirect off;
  51. proxy_pass http://v2ray:1312;
  52. proxy_http_version 1.1;
  53. # WebSocket upgrade headers (CRITICAL for WS to work)
  54. proxy_set_header Upgrade $http_upgrade;
  55. proxy_set_header Connection "upgrade";
  56. # Required headers
  57. proxy_set_header Host $host;
  58. proxy_set_header X-Real-IP $remote_addr;
  59. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  60. proxy_set_header X-Forwarded-Proto $scheme;
  61. # Long timeout for persistent connections
  62. proxy_read_timeout 86400s;
  63. proxy_send_timeout 86400s;
  64. # Disable buffering for real-time streaming
  65. proxy_buffering off;
  66. }
  67. # ============================================
  68. # Fallback - Return 404 for unmatched paths
  69. # ============================================
  70. location / {
  71. return 404;
  72. }