<p>I am working on project with microservices, and i have some issues.
I have a ReactJS frontend, and a ASP.NET API, and i am working on docker/kubernetes environment.
I try to fetch data on my front from API like this :</p>

<pre><code>    const https = require("https");
    const agent = new https.Agent({
        mode: "cors",
        method: 'GET',
        rejectUnauthorized: false
    })
    return fetch(hostApi1 +'/api/Weather/Index', { agent })

</code></pre>

<p>hostapi1=<a href="https://10.0.96.227:5001" rel="nofollow noreferrer">https://10.0.96.227:5001</a>
The Frontend have a public ip, and the api a private ip.</p>

<p>But the console return this error : </p>

<p><code>FetchWeather.tsx:130 GET https://10.0.96.227:5001/api/Weather/Index net::ERR_CONNECTION_TIMED_OUT</code></p>

<p>But when i try this from the front container :</p>

<p><code>curl -k https://10.0.96.227:5001/api/Weather/Index</code></p>

<p>I obtain a good response with my data.</p>

<p>So there some specifics to add in my request for fetch data on API with private IP ?
(when i add a public ip for my api it works, but this this not the aim)</p>

<p>Thanks for any help.</p>

cocobiño
<p>Your ReactJS frontend is running in user's browser. So you need to connect to backend using external IP. You cannot use private cluster ip from outside the cluster.</p>
