Skip to content

Commit

Permalink
Simplify vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ruffsl committed May 5, 2023
1 parent 8d04b2c commit ff3298f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
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 WsScheme "wss"
# Else default to "ws"
vars WsScheme "ws://"
vars WsScheme "ws"

# Matcher for forwarded request headers
@host_forwarded {
Expand All @@ -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.WsScheme}://{vars.WsHost}{path.dir}
}

# Listen for http requests on port 8080
Expand Down

0 comments on commit ff3298f

Please sign in to comment.