Its weird, after testing it through curl it seems my react app was already working since I have this output.
➜ contacts git:(main) ✗ curl -v contacts.localhost
* Trying ::1:80...
* Connected to contacts.localhost (::1) port 80 (#0)
> GET / HTTP/1.1
> Host: contacts.localhost
> User-Agent: curl/7.74.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: no-cache
< Content-Length: 669
< Content-Type: text/html
< Date: Wed, 30 Jun 2021 08:28:44 GMT
< Etag: W/"29d-AHMxgoAUgqO3XXQuc+QE5QVeAEI"
<
<!DOCTYPE html>
<html lang="en">
<head>
<script type="module" src="/@vite/client"></script>
<script type="module">
import RefreshRuntime from "/@react-refresh"
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
</script>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
* Connection #0 to host contacts.localhost left intact
Its corresponding log
traefik_1 | time="2021-06-30T08:29:54Z" level=debug msg="vulcand/oxy/roundrobin/rr: begin ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.74.0\"],\"X-Forwarded-Host\":[\"contacts.localhost\"],\"X-Forwarded-Port\":[\"80\"],\"X-Forwarded-Proto\":[\"http\"],\"X-Forwarded-Server\":[\"529518b91f3b\"],\"X-Real-Ip\":[\"172.24.0.1\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"contacts.localhost\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.24.0.1:38984\",\"RequestURI\":\"/\",\"TLS\":null}"
traefik_1 | time="2021-06-30T08:29:54Z" level=debug msg="vulcand/oxy/roundrobin/rr: Forwarding this request to URL" ForwardURL="http://172.24.0.4:3000" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.74.0\"],\"X-Forwarded-Host\":[\"contacts.localhost\"],\"X-Forwarded-Port\":[\"80\"],\"X-Forwarded-Proto\":[\"http\"],\"X-Forwarded-Server\":[\"529518b91f3b\"],\"X-Real-Ip\":[\"172.24.0.1\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"contacts.localhost\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.24.0.1:38984\",\"RequestURI\":\"/\",\"TLS\":null}"
traefik_1 | time="2021-06-30T08:29:55Z" level=debug msg="vulcand/oxy/roundrobin/rr: completed ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.74.0\"],\"X-Forwarded-Host\":[\"contacts.localhost\"],\"X-Forwarded-Port\":[\"80\"],\"X-Forwarded-Proto\":[\"http\"],\"X-Forwarded-Server\":[\"529518b91f3b\"],\"X-Real-Ip\":[\"172.24.0.1\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"contacts.localhost\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.24.0.1:38984\",\"RequestURI\":\"/\",\"TLS\":null}"
traefik_1 | 172.24.0.1 - - [30/Jun/2021:08:29:54 +0000] "GET / HTTP/1.1" 200 669 "-" "-" 2 "client@docker" "http://172.24.0.4:3000" 2ms
Although its correctly returns the app, I still can't access the host directly in the browser.