title: net::ERR_CONNECTION_TIMED_OUT for a POST request from REACT.js front-end to node.js back-end after deployment
body: <p>I have been trying to solve a problem with my app after deployment, before deployment on my local server and local network. http://localhost:3010 and <a href="http://192.168.XX.XXX" rel="nofollow noreferrer">http://192.168.XX.XXX</a> where my Node.js backend connects to my react front-end and works fine. That is, POST, GET request etc.. all work very fine, there's no issue.</p>
  <p>I then deployed my app externally where 192.168.xx (which was working fine in intranet network) is pointed to external network via domain (app.testSetup.de). However after deployment, the react front end loads up fine, but then making request to the node back-end (<a href="http://192.168.XX.XXX/auth/login" rel="nofollow noreferrer">http://192.168.XX.XXX/auth/login</a>) keeps giving the error net::ERR_CONNECTION_TIMED_OUT. So it basically never makes the request completely.</p>
  <p>The screenshot of the image is as shown. I have set my node_env still in development, while the external link is just a pointing to the internal intranet to access it from outside (internet)
  <a href="https://i.stack.imgur.com/TWB3u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TWB3u.png" alt="enter image description here" /></a></p>
  <p>I tried changing all the request urls from 'http://localhost:3010/login' to the absolute path of the app 'http://192.168.XX.XXX:3010/login' .</p>
  <p>I tried with adding proxy from the react front end in <code>package.json</code>  'http://192.168.XX.XXX:3010', all to no avail, it still doesn't work.</p>
  <p>I used postman as well, and its the same error. also my app uses cors(), but there's no configuration for it. <a href="https://www.npmjs.com/package/cors#simple-usage-enable-all-cors-requests" rel="nofollow noreferrer">https://www.npmjs.com/package/cors#simple-usage-enable-all-cors-requests</a>. So i allow all CORS request.</p>
  <p>Anyone have a clue what the issue could be here please ?</p>
  <p>Example of a component, which makes a POST request:</p>
  <pre class="lang-js prettyprint-override"><code>import axios from &quot;../axiosInstance&quot;;
  
  ...
      export const login = (email, password, org) =&gt; async (dispatch) =&gt; {
        dispatch(slice.actions.loading({ loading: true }));
        localStorage.setItem(&quot;Org&quot;, org);
        setURL(org);
        setTimeout(() =&gt; {
          console.log(&quot;hi&quot;);
        }, 500);
        axios
          .post(&quot;/auth/login&quot;, { email, password })
          .then((x) =&gt; {
            dispatch(slice.actions.login(x.data));
            setSession(x.data);
          })
          .catch((e) =&gt; {
            dispatch(slice.actions.loading({ loading: false }));
            dispatch(slice.actions.setErr({ err: e }));
          });
      };
  </code></pre>
  <p>Axios call configuration is setup as follows:</p>
  <pre class="lang-js prettyprint-override"><code>    import axios from &quot;axios&quot;;
      
      const axiosInstance = axios.create();
      axiosInstance.defaults.baseURL = &quot;http://192.168.XX.XXX:3010&quot;;
      ...
  
  export default axiosInstance;
  </code></pre>