From 65859731c300e6a4190c2aab0df09ecc8e8b61d8 Mon Sep 17 00:00:00 2001 From: oznchex <114240463+oznchex@users.noreply.github.com> Date: Thu, 25 Jul 2024 00:11:24 +0900 Subject: [PATCH] fix : image nginx error fix --- .platform/conf.d/client_max_body_size.conf | 1 - .platform/nginx.conf | 6 ++++++ .../java/liaison/linkit/image/service/ImageService.java | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) delete mode 100644 .platform/conf.d/client_max_body_size.conf diff --git a/.platform/conf.d/client_max_body_size.conf b/.platform/conf.d/client_max_body_size.conf deleted file mode 100644 index c1800890..00000000 --- a/.platform/conf.d/client_max_body_size.conf +++ /dev/null @@ -1 +0,0 @@ -client_max_body_size 5M; diff --git a/.platform/nginx.conf b/.platform/nginx.conf index f0ba394f..b64b09b4 100644 --- a/.platform/nginx.conf +++ b/.platform/nginx.conf @@ -14,6 +14,8 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; + client_max_body_size 5M; + types_hash_max_size 2048; server_names_hash_bucket_size 64; @@ -36,6 +38,8 @@ http { listen 80 default_server; listen [::]:80 default_server; + client_max_body_size 5M; + location / { proxy_pass http://springboot; # CORS 관련 헤더 추가 @@ -49,6 +53,8 @@ http { 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 5M; } access_log /var/log/nginx/access.log main; diff --git a/src/main/java/liaison/linkit/image/service/ImageService.java b/src/main/java/liaison/linkit/image/service/ImageService.java index d638f3ae..0b1aab1c 100644 --- a/src/main/java/liaison/linkit/image/service/ImageService.java +++ b/src/main/java/liaison/linkit/image/service/ImageService.java @@ -22,7 +22,6 @@ public class ImageService { private final S3Uploader s3Uploader; private final ApplicationEventPublisher publisher; - public MiniProfileImageResponse save(final MultipartFile miniProfileImageFile) { validateSizeOfImage(miniProfileImageFile); final ImageFile imageFile = new ImageFile(miniProfileImageFile);