Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

196
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda