Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
How do I remove the remote URL being added to an Axios POST request?

I have a React Web Application and a NodeJS Server, both deployed to Ubuntu EC2 instances. I've confirmed that API calls can be made between them using a CURL request to the private IP address (they're both in the same subnet).

However when I make the call from the React application, the POST request URL is prefixed with the remote URL which causes the API call to fail.

Chrome Developer Tools

The request URL is meant to be http://10.11.1.147/login

It works fine when running both applications on localhost. The API framework is implemented using Axios and React-Query.

Here is the query function performing the POST request (and I've confirmed that REACT_APP_SERVER_URL is the private IP address)

export const postLogin = async ({ email, password }) => {
  let response;
  const cookies = new Cookies();
  try {
    response = await axios.post(`${process.env.REACT_APP_SERVER_URL}/login`, {
      email: email,
      password: password,
    });
    cookies.set("JWT", response.data.jwt, { path: "/" });
    cookies.set("UserId", response.data.userId, { path: "/" });
  } catch (err) {
    return err.response
  }
};
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!