diff --git a/.platform/nginx/conf.d/proxy.conf b/.platform/nginx/conf.d/proxy.conf index 67d42de..c708d1b 100644 --- a/.platform/nginx/conf.d/proxy.conf +++ b/.platform/nginx/conf.d/proxy.conf @@ -1 +1,19 @@ -client_max_body_size 10M; +location / { + proxy_pass http://springboot; + + # CORS 관련 헤더 추가 + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; + + proxy_http_version 1.1; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Upgrade $http_upgrade; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # 요청 본문 최대 크기 설정 + client_max_body_size 30M; # 원하는 크기로 조정 +} diff --git a/.platform/nginx/nginx.conf b/.platform/nginx/nginx.conf index d4b4862..4c06b06 100644 --- a/.platform/nginx/nginx.conf +++ b/.platform/nginx/nginx.conf @@ -11,54 +11,40 @@ events { } http { - include /etc/nginx/mime.types; - default_type application/octet-stream; + include /etc/nginx/mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; + include conf.d/*.conf; # proxy.conf가 여기에서 포함됩니다. - include conf.d/*.conf; + map $http_upgrade $connection_upgrade { + default "upgrade"; + } - map $http_upgrade $connection_upgrade { - default "upgrade"; - } + upstream springboot { + server 127.0.0.1:8080; + keepalive 1024; + } - upstream springboot { - server 127.0.0.1:8080; - keepalive 1024; - } + server { + listen 80 default_server; + listen [::]:80 default_server; - server { - listen 80 default_server; - listen [::]:80 default_server; + # proxy.conf에서 location 블록을 포함 + include conf.d/proxy.conf; - location / { - proxy_pass http://springboot; - # CORS 관련 헤더 추가 - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; - proxy_http_version 1.1; - proxy_set_header Connection $connection_upgrade; - proxy_set_header Upgrade $http_upgrade; + access_log /var/log/nginx/access.log main; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - client_max_body_size 0; - } + client_header_timeout 60; + client_body_timeout 60; + keepalive_timeout 60; + gzip off; + gzip_comp_level 4; - access_log /var/log/nginx/access.log main; - - client_header_timeout 60; - client_body_timeout 60; - keepalive_timeout 60; - gzip off; - gzip_comp_level 4; - - # Include the Elastic Beanstalk generated locations - include conf.d/elasticbeanstalk/healthd.conf; - } + # Include the Elastic Beanstalk generated locations + include conf.d/elasticbeanstalk/healthd.conf; + } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index bfed61f..09f4519 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -11,7 +11,7 @@ spring: jpa: show-sql: true hibernate: - ddl-auto: update + ddl-auto: create properties: hibernate: dialect: org.hibernate.dialect.MySQL8Dialect