diff --git a/.platform/nginx/01_nginx.config b/.platform/nginx/01_nginx.config index 7b23679..5d52978 100644 --- a/.platform/nginx/01_nginx.config +++ b/.platform/nginx/01_nginx.config @@ -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; \ No newline at end of file + "/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 애플리케이션이 실행 중인 포트 + } + }