diff --git a/.devcontainer/caddy/Caddyfile b/.devcontainer/caddy/Caddyfile index 6dd9fbf7d18..b123c0bb634 100644 --- a/.devcontainer/caddy/Caddyfile +++ b/.devcontainer/caddy/Caddyfile @@ -28,18 +28,18 @@ expression {http.request.scheme}=="https" || {header.X-Forwarded-Scheme}=="https" } # If any http scheme is "https", then use "wss" - vars @http_scheme WsScheme "wss" + vars @http_scheme ws.scheme "wss" # Else default to "ws" - vars WsScheme "ws" + vars ws.scheme "ws" # Matcher for forwarded request headers @host_forwarded { header X-Forwarded-Host * } # If http headers exists, then use them - vars @host_forwarded WsHost {header.X-Forwarded-Host} + vars @host_forwarded ws.host {header.X-Forwarded-Host} # Else default to host in request - vars WsHost {http.request.hostport} + vars ws.host {http.request.hostport} } # Snippet for redirect with given URL queries values @@ -47,7 +47,7 @@ # E.g auto redirect websocket URL to match request scheme (redirect) { # Configure redirect to match request scheme - redir /{args.0}/nav2 /{args.0}/?ds=foxglove-websocket&ds.url={vars.WsScheme}://{vars.WsHost}{path.dir} + redir /{args.0}/nav2 /{args.0}/?ds=foxglove-websocket&ds.url={vars.ws.scheme}://{vars.ws.host}{path.dir} } # Listen for http requests on port 8080 diff --git a/.devcontainer/caddy/index.md b/.devcontainer/caddy/index.md index a91ce414fca..da704c2387a 100644 --- a/.devcontainer/caddy/index.md +++ b/.devcontainer/caddy/index.md @@ -34,5 +34,5 @@ | `header.X-Forwarded-Scheme` | `{{placeholder "header.X-Forwarded-Scheme"}}` | | `http.request.hostport` | `{{placeholder "http.request.hostport"}}` | | `http.request.scheme` | `{{placeholder "http.request.scheme"}}` | -| `http.vars.WsHost` | `{{placeholder "http.vars.WsHost"}}` | -| `http.vars.WsScheme` | `{{placeholder "http.vars.WsScheme"}}` | +| `http.vars.ws.host` | `{{placeholder "http.vars.ws.host"}}` | +| `http.vars.ws.scheme` | `{{placeholder "http.vars.ws.scheme"}}` |