Skip to content

Commit

Permalink
Merge pull request #4 from Team-hangout/build/3/nginx
Browse files Browse the repository at this point in the history
Build/3/nginx
  • Loading branch information
ohhonggi authored Oct 5, 2023
2 parents 048d94d + e80d4d7 commit 33594b2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
version: "3.7"

services:
nginx:
container_name: nginx
image: nginx
ports:
- 80:80
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
depends_on:
- backend
networks:
- app-tier

frontend:
container_name: frontend
#Dockerfile의 경로
Expand Down
12 changes: 12 additions & 0 deletions nginx/conf.d/app.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
server {
listen 80;
access_log off;

location / {
proxy_pass http://backend:8080; # docker-compose에서 설정한 이름이 backend
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

0 comments on commit 33594b2

Please sign in to comment.