Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

372
Visualizações
Angular Container hosted by NGINX Webserver Fails to call a WebApi in another server

DockerFile of Angular

# stage 1
FROM node:latest as node
WORKDIR /usr/src/app

COPY package.json /usr/src/app
COPY proxy.conf.json /usr/src/app
RUN npm install
COPY . /usr/src/app
#CMD ng serve --host 0.0.0.0
RUN npm run build
#ENTRYPOINT npm proxy

# Stage 2
FROM nginx:1.13.12-alpine

COPY --from=node /usr/src/app/dist/miniRws /usr/share/nginx/html

COPY ./nginx.conf /etc/nginx/conf.d/default.conf

nginx.config

server {
  listen 80;  

  location / {
    root /usr/share/nginx/html;
    index index.html index.htm;
    try_files $uri $uri/ /index.html =404;
  }
}

proxy.config

{
  "/api1": {  
    "target": "http://examwebapicontainer",
    "secure": false,
    "logLevel": "debug",
    "changeOrigin": true
  }
}

package.json : partial


"scripts": {
  "ng": "ng",
  "start": "ng serve --proxy-config proxy.config.json",
  "proxy": "ng serve --proxy-config proxy.conf.json --host 0.0.0.0",
  "build": "ng build"
}

I am told we have to somehow add

proxy_pass http://examwebapicontainer into the nginx.conf file

Can anyone help with editing the configuration files so that I can call the WebApi from the angular container

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda