mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
48 lines
1.9 KiB
Plaintext
48 lines
1.9 KiB
Plaintext
# foreign content route used by vscode to serve webview and webworker resources of the form
|
|
# https://{{hash_base_32}}.<cluster>.<gitpod_domain> or https://v--{{hash_base_32}}.<cluster>.<gitpod_domain>
|
|
# e.g:
|
|
# https://0d9rkrj560blqb5s07q431ru9mhg19k1k4bqgd1dbprtgmt7vuhk.ws-us34xl.gitpod.io (for webviews)
|
|
# https://v--0d9rkrj560blqb5s07q431ru9mhg19k1k4bqgd1dbprtgmt7vuhk.ws-us34xl.gitpod.io (for webworker)
|
|
@foreign_content2 header_regexp host Host ^(?:v--)?[0-9a-v]+.ws(-[a-z0-9]+)?.{$GITPOD_DOMAIN}
|
|
handle @foreign_content2 {
|
|
reverse_proxy https://ws-proxy.{$KUBE_NAMESPACE}.{$KUBE_DOMAIN}:9090 {
|
|
import workspace_transport
|
|
|
|
header_up X-WSProxy-Host {http.request.host}
|
|
}
|
|
}
|
|
|
|
@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 {
|
|
reverse_proxy https://ws-proxy.{$KUBE_NAMESPACE}.{$KUBE_DOMAIN}:9090 {
|
|
import workspace_transport
|
|
|
|
header_up X-Gitpod-WorkspaceId {re.host.workspaceID}
|
|
header_up X-Gitpod-Port {re.host.workspacePort}
|
|
header_up X-WSProxy-Host {http.request.host}
|
|
}
|
|
}
|
|
|
|
# experimental debug workspace route
|
|
@debug_workspace header_regexp host Host ^debug-(?P<workspaceID>[a-z0-9][0-9a-z\-]+).ws(?P<location>-[a-z0-9]+)?.{$GITPOD_DOMAIN}
|
|
handle @debug_workspace {
|
|
reverse_proxy https://ws-proxy.{$KUBE_NAMESPACE}.{$KUBE_DOMAIN}:9090 {
|
|
import workspace_transport
|
|
|
|
header_up X-Gitpod-WorkspaceId {re.host.workspaceID}
|
|
header_up X-WSProxy-Host {http.request.host}
|
|
}
|
|
}
|
|
|
|
@workspace header_regexp host Host ^(?P<workspaceID>[a-z0-9][0-9a-z\-]+).ws(?P<location>-[a-z0-9]+)?.{$GITPOD_DOMAIN}
|
|
handle @workspace {
|
|
reverse_proxy https://ws-proxy.{$KUBE_NAMESPACE}.{$KUBE_DOMAIN}:9090 {
|
|
import workspace_transport
|
|
|
|
header_up X-Gitpod-WorkspaceId {re.host.workspaceID}
|
|
header_up X-WSProxy-Host {http.request.host}
|
|
}
|
|
}
|
|
|
|
respond "Not found" 404
|