When developing on Linux, Docker does not automatically redirect host ports to the containers, and thus caddy can't connect to backend that is running locally.
Tested on MacOS and Asahi Linux aarch64, the problem exists on Linux, does not exist on MacOS, mitigated by this patch on Linux, does not affect MacOS.
When developing on Linux, Docker does not automatically redirect host ports to the containers, and thus caddy can't connect to backend that is running locally.
Here's the workaround that fixes it. https://stackoverflow.com/questions/31324981/how-to-access-host-port-from-docker-container/61424570#61424570
This PR implements it.
Tested on MacOS and Asahi Linux aarch64, the problem exists on Linux, does not exist on MacOS, mitigated by this patch on Linux, does not affect MacOS.