memory-bank/components/proxy.md
The Proxy is a critical component in Gitpod that serves as the main entry point for all HTTP and WebSocket traffic to the platform. It routes requests to the appropriate backend services, handles TLS termination, enforces security policies, and provides various routing and transformation capabilities for the Gitpod platform.
The primary purposes of the Proxy component are:
The Proxy is built on Caddy, a powerful, extensible web server with automatic HTTPS capabilities. The Gitpod proxy extends Caddy with custom plugins to handle specific Gitpod requirements:
Dockerfile: Builds the proxy container with Caddy and custom pluginsconf/Caddyfile: Main configuration file for the proxyconf/workspace-handler.full: Configuration for handling workspace requestsconf/workspace-handler.meta: Configuration for handling workspace metadataplugins/: Custom Caddy plugins for Gitpod-specific functionalityThe proxy includes several custom Caddy plugins to extend its functionality:
The proxy is configured via the Caddyfile, which includes:
The proxy implements sophisticated routing logic:
Workspace routing is particularly complex, handling several patterns:
<workspace-id>.ws.<region>.<domain><port>-<workspace-id>.ws.<region>.<domain>debug-<workspace-id>.ws.<region>.<domain>The proxy implements several security measures:
The Proxy is typically used to: