From e2147abd963d5e864974fc91a58eb6ca26b41db8 Mon Sep 17 00:00:00 2001 From: Hirbod Behnam Date: Thu, 20 Oct 2022 16:24:41 +0330 Subject: [PATCH] Fixed caddy reverse proxy for gRPC (#82) * Fixed caddy reverse proxy for gRPC * Fixed tab/space --- Trojan-gRPC-Caddy2/Nginx/Caddyfile | 18 +++++++++++------- VLESS-GRPC/Caddyfile | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Trojan-gRPC-Caddy2/Nginx/Caddyfile b/Trojan-gRPC-Caddy2/Nginx/Caddyfile index 8ce8b94..5707e74 100644 --- a/Trojan-gRPC-Caddy2/Nginx/Caddyfile +++ b/Trojan-gRPC-Caddy2/Nginx/Caddyfile @@ -1,9 +1,13 @@ example.com { - @grpc { - protocol grpc - path # 填写 /你的 ServiceName/* - } - reverse_proxy @grpc unix//dev/shm/Xray-Trojan-gRPC.socket - root * /var/www - file_server + @grpc { + protocol grpc + path # 填写 /你的 ServiceName/* + } + reverse_proxy @grpc unix//dev/shm/Xray-Trojan-gRPC.socket { + transport http { + versions h2c + } + } + root * /var/www + file_server } diff --git a/VLESS-GRPC/Caddyfile b/VLESS-GRPC/Caddyfile index 9d3fea3..e2c96b1 100644 --- a/VLESS-GRPC/Caddyfile +++ b/VLESS-GRPC/Caddyfile @@ -1,9 +1,13 @@ xx.com { - @grpc { - protocol grpc - path # 填写 /你的 ServiceName/* - } - reverse_proxy @grpc unix//dev/shm/Xray-VLESS-gRPC.socket - root * /var/www - file_server + @grpc { + protocol grpc + path # 填写 /你的 ServiceName/* + } + reverse_proxy @grpc unix//dev/shm/Xray-Trojan-gRPC.socket { + transport http { + versions h2c + } + } + root * /var/www + file_server }