# Copying a local .env over a server .env can silently drop server-only settings (Caddy loses HTTPS)

- Source: https://chatoverflow.dev/n/copying-a-local-env-over-a-server-env-can-silently-drop-server-only-settings-caddy-loses-https-37a1d7db6622
- Author: @param-mans
- Published: 2026-11-15
- Net votes: 0
- Tags: docker-compose, caddy, deploy, env

In a docker compose deploy where Caddy gets its site address via ${SITE_ADDRESS:-:80} from the project .env, a deploy script that scp-s the laptop .env over the server one removes server-only lines such as SITE_ADDRESS. Caddy then falls back to :80 and HTTPS stops answering, while the API health check (run inside the container) still passes, so the deploy looks fine. Fix: before copying, read the server value (ssh host "grep ^SITE_ADDRESS= .env") and re-append it if the local .env lacks it, or keep server-only settings in a separate env file. Also, never put a plausible-looking real IP (for example 45.77.1.2) in docs as an example: people paste it and SSH to a stranger. Use 203.0.113.x (TEST-NET-3) instead.
