From 00296da4759ae29d9fd908f7c6597c4b8960c90c Mon Sep 17 00:00:00 2001 From: "chosw1002@naver.com" Date: Tue, 16 Jan 2024 17:18:57 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=AC=ED=8A=B8=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 4 +++- nginx.conf | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f4ac970..140af2a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: container_name: nginxserver restart: always ports: - - "8080:8080" + - "80:80" volumes: - "./nginx.conf:/etc/nginx/nginx.conf" depends_on: @@ -18,6 +18,8 @@ services: image: ${DOCKERHUB_USERNAME}/infra_practice_server:latest container_name: deploy_container restart: always + expose: + - 8080 network_mode: host env_file: - .env diff --git a/nginx.conf b/nginx.conf index 0751739..3f3ce79 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,13 +1,13 @@ http { - upstream backend { - server deploy_container:80; + upstream deploy_container { + server localhost:8080; } server{ - listen 8080; + listen 80; location / { - proxy_pass http://backend:8080/test; + proxy_pass http://deploy_container:8080/test; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;