From 561ce4963e9c194514863b3e7e7f116f91c5a1f9 Mon Sep 17 00:00:00 2001 From: EIKULG <34759969+EIKULG@users.noreply.github.com> Date: Fri, 19 Mar 2021 12:08:16 +0800 Subject: [PATCH] Update Caddyfile --- Caddy2-WS-H2C-GRPC/Caddyfile | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/Caddy2-WS-H2C-GRPC/Caddyfile b/Caddy2-WS-H2C-GRPC/Caddyfile index 0c4c191..7aeb9fc 100644 --- a/Caddy2-WS-H2C-GRPC/Caddyfile +++ b/Caddy2-WS-H2C-GRPC/Caddyfile @@ -1,27 +1,21 @@ xx.com { - @ws { + @ws { path /ws header Connection *Upgrade* header Upgrade websocket - } - @grpc { - protocol grpc - } - reverse_proxy @ws { - to http://127.0.0.1:2001 - } - reverse_proxy @grpc { - to h2c://127.0.0.1:2002 + } + @grpc protocol grpc + reverse_proxy @ws http://127.0.0.1:2001 + reverse_proxy @grpc h2c://127.0.0.1:2002 { transport http { - versions h2c 2 + versions h2c } - } - reverse_proxy /h2 { - to h2c://127.0.0.1:2003 + } + reverse_proxy /h2 h2c://127.0.0.1:2003 { transport http { - versions h2c 2 + versions h2c } - } - root * /var/www - file_server + } + root * /var/www + file_server }