Use Caddy (brew install caddy
) to run localhost sites with custom addresses and https certificates.
- Run
caddy reverse-proxy --from site.localhost --to localhost:3000
- Visit
https://site.localhost/
For a more stable config, create a Caddyfile
site.localhost {
reverse_proxy localhost:3000
}
api.localhost {
reverse_proxy localhost:3001
}
And start it in the background with caddy start
or in the foreground with caddy run