Search code examples
typescriptdockerkubernetesnext.jsnginx-ingress

Receive "Request failed with status code 502 nginx in nextjs typescript


I have configured Next.js typescript with Kubernetes NGINX Ingress but at the moment of accessing it it sends me 502 to specific routes but not to the entire project vgr .: in /test it works fine but in /login it does not work. I don't know how to reproduce the error to know what is happening. I don't know if Kubernetes or Docker is misconfigured.

enter image description here enter image description here enter image description here

full config in this GitHub repository


Solution

  • replace dockerfile

    FROM node:alpine
    WORKDIR /app
    COPY package*.json ./
    RUN npm install
    COPY . .
    RUN npm run build
    CMD ["npm", "run", "start"]