root layout

패스트캠퍼스

  1. 강의 질문
  2. 프로그래밍

Nginx 502 BAD GateWay

2025.02.17 06:37 수정

services:

   backend:

      container_name: backend

      build:

         context: ./Back-spring

         dockerfile: Dockerfile

      restart: always

      ports:

         - '8081:8080'

      networks:

         - mynet



   nginx:

      image: nginx:latest

      container_name: nginx

      restart: always

      depends_on:

         - backend

      ports:

         - '8080:80'

      volumes:

         - ./proxy/nginx-be.conf:/etc/nginx/nginx.conf

      networks:

         - mynet



networks:

   mynet:

      driver: bridge


events {

        worker_connections 1024;

}



http{

   

        server {

                listen 80;

        location / {

                proxy_pass http://backend:8081;

                }

        }



}


위와 같이 Docker-compose 와 nginx.conf 파일을 작성하였는데 localhost:8080으로 접근할 경우 502 BAD GateWay 문제가 해결이 되지 않습니다 도와주세요 ㅜㅜ


답변 

연관 질문

커뮤니티 질문보기