Exposing DDEV projects to a Tailnet
I wanted to debug DDEV projects running on my development server from other devices on the same Tailscale Tailnet. I first tried ddev-tailscale-router, but its per-project setup was more than I needed.
I instead put one proxy in front of DDEV. It discovers running projects, assigns stable ports, and exposes them through the server's Tailnet hostname.
The proxy
DDEV routes each request from its Host header, usually <project>.ddev.site. Applications can also redirect to that canonical host, which another Tailnet device cannot resolve.
The proxy sends the DDEV host to ddev-router, then rewrites redirects, cookie domains, and common text responses to the Tailnet URL. Nginx runs on DDEV's Docker network, while Tailscale Serve publishes only loopback ports.
Install
ddev-tailnet-proxy is available for testing. It uses Bash, Nginx, Docker, Tailscale Serve, and systemd.
mise use -g github:titouanmathis/[email protected]
sudo "$(mise which ddev-tailnet-proxy)" service install
The service refreshes every two minutes. It adds new running projects and removes stopped ones from the active proxy configuration.
ddev-tailnet-proxy status
sudo ddev-tailnet-proxy service status
I use it with simple DDEV projects. Advanced DDEV network configurations still need testing.