-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
383 additions
and
69 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
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,12 @@ | ||
{ | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "ecs-tasks.amazonaws.com" | ||
}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} |
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,14 @@ | ||
version: 1 | ||
task_definition: | ||
task_execution_role: ecs-instance | ||
task_size: | ||
mem_limit: 512 | ||
cpu_limit: 256 | ||
run_params: | ||
network_configuration: | ||
awsvpc_configuration: | ||
subnets: | ||
- "subnet-0a00bab6d3dec1b98" | ||
- "subnet-024304174c7677aa4" | ||
security_groups: | ||
- "sg-02883320b4d5e11a9" |
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,2 @@ | ||
#/bin/bash date -d | ||
echo ECS_CLUSTER=jts-cluster >> /etc/ecs/ecs.config |
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,12 @@ | ||
FROM nginx:1.19.5-alpine | ||
|
||
RUN rm /etc/nginx/conf.d/default.conf | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY server.conf /etc/nginx/conf.d | ||
|
||
RUN mkdir /data \ | ||
&& mkdir /data/nginx \ | ||
&& mkdir /data/nginx/temp \ | ||
&& mkdir /data/nginx/cache | ||
EXPOSE 80 |
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,44 @@ | ||
user nginx; | ||
worker_processes 2; | ||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
# gzip 설정 | ||
gzip on; | ||
gzip_proxied any; | ||
gzip_types text/plain application/json; | ||
gzip_min_length 1000; | ||
|
||
# 용량이 큰 파일을 업로드 가능하도록 설정 | ||
client_max_body_size 10M; | ||
|
||
server_tokens off; | ||
fastcgi_hide_header X-Powered-By; | ||
fastcgi_hide_header X-Pingback; | ||
fastcgi_hide_header Link; | ||
proxy_hide_header X-Powered-By; | ||
proxy_hide_header X-Pingback; | ||
proxy_hide_header X-Link; | ||
|
||
# 캐시 저장소 | ||
proxy_cache_path /data/nginx/cache keys_zone=one:10m; | ||
|
||
# 임시 파일 저장소 | ||
proxy_temp_path /data/nginx/temp; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
keepalive_timeout 65; | ||
include /etc/nginx/conf.d/*.conf; | ||
} |
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,61 @@ | ||
upstream algoweb { | ||
ip_hash; | ||
server django:5000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name api.asports.kr; | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
|
||
# .py 나 .log 파일들에 접근을 차단 | ||
location ~ /\. { | ||
deny all; | ||
} | ||
location ~* ^.+\.(py|log)$ { | ||
deny all; | ||
} | ||
|
||
set $bucket "algo-sports-bucket.s3.amazonaws.com"; | ||
|
||
# static 설정 | ||
location /static/ { | ||
try_files $uri @s3; | ||
# http://$bucket/static/; | ||
} | ||
|
||
# media 설정 | ||
location /media/ { | ||
try_files $uri @s3; | ||
# proxy_pass http://$bucket/media/; | ||
} | ||
|
||
location @s3 { | ||
set $url_full '$1'; | ||
|
||
proxy_http_version 1.1; | ||
proxy_set_header Host $bucket; | ||
proxy_set_header Authorization ''; | ||
proxy_hide_header x-amz-id-2; | ||
proxy_hide_header x-amz-request-id; | ||
proxy_hide_header x-amz-meta-server-side-encryption; | ||
proxy_hide_header x-amz-server-side-encryption; | ||
proxy_hide_header Set-Cookie; | ||
proxy_ignore_headers Set-Cookie; | ||
proxy_intercept_errors on; | ||
|
||
resolver 8.8.4.4 8.8.8.8 valid=300s; | ||
resolver_timeout 10s; | ||
proxy_pass http://$bucket$url_full; | ||
} | ||
|
||
location / { | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $host; | ||
proxy_redirect off; | ||
proxy_pass http://algoweb; | ||
} | ||
} |
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
Oops, something went wrong.