-
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.
hotfix : nginx 설정 다 지워도 오류 발생 - 다시 설정
- Loading branch information
1 parent
ac8cb4b
commit f938733
Showing
2 changed files
with
101 additions
and
51 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 |
---|---|---|
@@ -1,51 +1,100 @@ | ||
# # .platform/nginx/conf.d/proxy.conf | ||
# files: | ||
# "/etc/nginx/conf.d/proxy.conf": | ||
# mode: "000644" | ||
# owner: root | ||
# group: root | ||
# content: | | ||
# client_max_body_size 50M; | ||
# | ||
# server { | ||
# listen 80; | ||
# server_name _; | ||
# | ||
# location / { | ||
# if ($request_method = 'OPTIONS') { | ||
# add_header 'Access-Control-Allow-Origin' '*'; | ||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS'; | ||
# add_header 'Access-Control-Allow-Headers' '*'; | ||
# add_header 'Access-Control-Allow-Credentials' 'true'; | ||
# return 204; | ||
# } | ||
# | ||
# add_header 'Access-Control-Allow-Origin' '*'; | ||
# add_header 'Access-Control-Allow-Credentials' 'true'; | ||
# | ||
# proxy_pass http://localhost:5000; | ||
# proxy_set_header Host $host; | ||
# proxy_set_header X-Real-IP $remote_addr; | ||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
# proxy_set_header X-Forwarded-Proto $scheme; | ||
# } | ||
# } | ||
# | ||
# server { | ||
# listen 443 ssl; | ||
# server_name _; | ||
# | ||
# ssl_certificate /etc/letsencrypt/live/yourdomain/fullchain.pem; | ||
# ssl_certificate_key /etc/letsencrypt/live/yourdomain/privkey.pem; | ||
# | ||
# location / { | ||
# if ($request_method = 'OPTIONS') { | ||
# add_header 'Access-Control-Allow-Origin' '*'; | ||
# add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS'; | ||
# add_header 'Access-Control-Allow-Headers' '*'; | ||
# add_header 'Access-Control-Allow-Credentials' 'true'; | ||
# return 204; | ||
# } | ||
# | ||
# add_header 'Access-Control-Allow-Origin' '*'; | ||
# add_header 'Access-Control | ||
# .platform/nginx/conf.d/proxy.conf | ||
files: | ||
"/etc/nginx/conf.d/proxy.conf": | ||
mode: "000644" | ||
owner: root | ||
group: root | ||
content: | | ||
client_max_body_size 50M; | ||
|
||
server { | ||
listen 80; | ||
server_name _; # 필요에 따라 실제 도메인으로 변경 | ||
|
||
location / { | ||
if ($request_method = 'OPTIONS') { | ||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS'; | ||
add_header 'Access-Control-Allow-Headers' '*'; | ||
add_header 'Access-Control-Allow-Credentials' 'true'; | ||
return 204; | ||
} | ||
|
||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Credentials' 'true'; | ||
|
||
proxy_pass http://localhost:5000; # Spring Boot 애플리케이션이 실행 중인 포트 | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /files/ { | ||
if ($request_method = 'OPTIONS') { | ||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS'; | ||
add_header 'Access-Control-Allow-Headers' '*'; | ||
add_header 'Access-Control-Allow-Credentials' 'true'; | ||
return 204; | ||
} | ||
|
||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Credentials' 'true'; | ||
|
||
proxy_pass https://techeer-market.s3.ap-northeast-2.amazonaws.com; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
server_name _; # 필요에 따라 실제 도메인으로 변경 | ||
|
||
ssl_certificate /etc/letsencrypt/live/yourdomain/fullchain.pem; # 실제 경로로 변경 | ||
ssl_certificate_key /etc/letsencrypt/live/yourdomain/privkey.pem; # 실제 경로로 변경 | ||
|
||
location / { | ||
if ($request_method = 'OPTIONS') { | ||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS'; | ||
add_header 'Access-Control-Allow-Headers' '*'; | ||
add_header 'Access-Control-Allow-Credentials' 'true'; | ||
return 204; | ||
} | ||
|
||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Credentials' 'true'; | ||
|
||
proxy_pass http://localhost:5000; # Spring Boot 애플리케이션이 실행 중인 포트 | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /files/ { | ||
if ($request_method = 'OPTIONS') { | ||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS'; | ||
add_header 'Access-Control-Allow-Headers' '*'; | ||
add_header 'Access-Control-Allow-Credentials' 'true'; | ||
return 204; | ||
} | ||
|
||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Credentials' 'true'; | ||
|
||
proxy_pass https://techeer-market.s3.ap-northeast-2.amazonaws.com; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
container_commands: | ||
01_reload_nginx: | ||
command: "service nginx reload" |