Skip to content

Commit

Permalink
feat : nginx에 cors 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayon-Hong committed Jun 26, 2024
1 parent bddc069 commit 7da7579
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .platform/nginx/01_nginx.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
container_commands:
01_reload_nginx:
command: "service nginx reload"

files:
"/etc/nginx/conf.d/proxy.conf":
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 50M;
"/etc/nginx/conf.d/proxy.conf":
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 50M;

server {
listen 80;

location /api/ {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' 'https://techeermarket.site';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Access-Control-Allow-Origin';
add_header 'Access-Control-Allow-Credentials' 'true';
return 204;
}

add_header 'Access-Control-Allow-Origin' 'https://techeermarket.site';
add_header 'Access-Control-Allow-Credentials' 'true';

proxy_pass http://localhost:5000; # Spring Boot 애플리케이션이 실행 중인 포트
}
}

0 comments on commit 7da7579

Please sign in to comment.