Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/proxy/conf/workspace-handler.meta
2500 views
# 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