-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Team-hangout/build/5/proxy
Build/5/proxy
- Loading branch information
Showing
4 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM nginx | ||
EXPOSE 80 | ||
RUN rm /etc/nginx/nginx.conf | ||
COPY ./nginx.conf /etc/nginx/nginx.conf |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
user nginx; | ||
worker_processes 1; | ||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; # 각 워커 프로세스가 동시에 처리할 수 있는 연결 수를 1024로 제한 | ||
} | ||
|
||
http { | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
server_tokens off; # 헤더에 NGINX 버전을 숨김 | ||
keepalive_timeout 30s; # Nginx 웹 서버에서 클라이언트와의 연결을 유지하는 시간을 정의 | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] $status ' | ||
'"$request" $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
upstream api { | ||
server backend:8080; # docker-compose에서 설정한 이름이 backend | ||
} | ||
|
||
upstream client { | ||
server frontend:3000; # docker-compose에서 설정한 이름이 frontend | ||
} | ||
|
||
server { | ||
|
||
listen 80; | ||
access_log off; | ||
|
||
location / { | ||
proxy_pass http://client; | ||
} | ||
|
||
location /api { | ||
|
||
proxy_http_version 1.1; | ||
proxy_pass http://api; | ||
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; | ||
|
||
} | ||
|
||
# location /api/v1 { #소셜 로그인 요청 API 추가 작성 (소셜 로그인 설정하실 때 필요하시면 쓰세요) | ||
# | ||
# | ||
# } | ||
} | ||
} | ||
|