- Install caddy the easiest way to download the binary
- Have a domain/subdomain that points to 127.0.0.1/0.0.0.0/localhost etc.
To make a domain point to localhost we can use
- hosts file (in mac iHost can be used for this)
- dnsmasq
caddy reverse-proxy --from anysubdomain.lvh.me --to :3000 --internal-certslvh.me is a service that always returns 127.0.0.1 as the dns configuration domain and subdomain
When you execute this step and go to https://anysubdomain.lvh.me you will receive a

To avoid this we need:
sudo bash -c "caddy start && caddy trust && caddy stop"After this reload the browser and will be done!!!
If you want to use it as service you can use the Caddyfile with your normal service manager. But if you only download the binary you can do
caddy start --config CaddyfileThis will load caddy in bg and can be stopped with caddy stop.
Updated in https://argami.github.io/2023/https-proxy-in-2-steps/