gitpod/components/proxy/conf/workspace-handler.meta
2023-02-01 10:20:39 +01:00

17 lines
737 B
Plaintext

# We have to differentiate two cases to mimic the ws-proxy behavior:
# - requests to the IDE frontend: redirect to "/start?not_found=true#..."
# - everything else: respond with 404
# We have to keep the port matcher because it's more specific than the workspace id matcher below
@workspace_port header_regexp host Host ^(?P<workspacePort>[0-9]{2,5})-(?P<workspaceID>[a-z0-9][0-9a-z\-]+).ws(?P<location>-[a-z0-9]+)?.{$GITPOD_DOMAIN}
handle @workspace_port {
respond "Not found" 404
}
@workspace header_regexp host Host ^(?P<workspaceID>[a-z0-9][0-9a-z\-]+).ws(?P<location>-[a-z0-9]+)?.{$GITPOD_DOMAIN}
handle @workspace {
redir https://{$GITPOD_DOMAIN}/start/?not_found=true#{re.host.workspaceID} temporary
}
respond "Not found" 404