Basically I want a container to call 'example.com' and when it does, it should go to Nginx which in turn forward the request to some-other-domain.com
This worked with curl and other basic applications.
This doesn't seem to work with Playwright though, for some reason Chrome just ignores the 'DNS' being set up here. For Playwright, I used this method with Squid.
Bring up the nginx
docker-compose up nginx
Then bring up the 'client', isntall curl, openssl, and make some requests. Notice that the IP resolves to the nginx container.
docker compose run --rm -it client /bin/bash
root@527e66b985d3:/# apt update && apt install -y curl openssl
root@527e66b985d3:/# curl -kv https://example.com
* Trying 10.1.0.100:443...
* Connected to example.com (10.1.0.100) port 443 (#0)