HTTPS behind a reverse proxy
Put Caddy or nginx with TLS in front of Glideworth, bind the container to loopback, and set the proxy and public URL variables correctly.
Do not expose the container’s port to the internet directly: it speaks plain HTTP. Put a reverse proxy that terminates TLS in front of it, on the same host.
Before you start: a running install, a domain name pointing at the machine, and ports 80 and 443 open.
-
Bind the container to loopback only, so that only the proxy can reach it. Create
docker-compose.override.ymlnext todocker-compose.yml(this needs Docker Compose 2.24 or newer for!override):services: glideworth: ports: !override - "127.0.0.1:8787:8787" -
In
.env, tell Glideworth it is behind a proxy and what its public address is:GLIDEWORTH_TRUST_PROXY=true GLIDEWORTH_COOKIE_SECURE=auto GLIDEWORTH_PUBLIC_URL=https://glideworth.example.com -
Run
docker compose up -dto apply, then configure the proxy below.
GLIDEWORTH_TRUST_PROXY=true makes the server trust the proxy’s X-Forwarded-For and X-Forwarded-Proto headers, for
sign-in throttling and the secure cookie. Set it only when a proxy you control is the sole way to reach the port,
otherwise clients can spoof their address. GLIDEWORTH_PUBLIC_URL is the OAuth issuer used for MCP sign-in from AI clients.
Caddy
Caddy obtains and renews the certificate itself and sets the forwarded headers.
glideworth.example.com {
encode zstd gzip
reverse_proxy 127.0.0.1:8787
}
nginx
server {
listen 80;
server_name glideworth.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
http2 on;
server_name glideworth.example.com;
# Certificates, for example from certbot.
ssl_certificate /etc/letsencrypt/live/glideworth.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/glideworth.example.com/privkey.pem;
# nginx's default is 1 MB; imports can be larger. Keep this at or above GLIDEWORTH_MAX_BODY_MB (default 10).
client_max_body_size 12m;
location / {
proxy_pass http://127.0.0.1:8787;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Long-running simulations and the MCP endpoint stream responses.
proxy_buffering off;
proxy_read_timeout 300s;
}
}
Check it: curl -fsS https://glideworth.example.com/health returns {"status":"ok",...}. A signed-in browser session over HTTPS
must receive a Secure cookie. If sign-in loops, see Troubleshooting.
Last checked against the code on .