diff --git a/docker-test-server/nginx.conf b/docker-test-server/nginx.conf new file mode 100644 index 0000000..670fde0 --- /dev/null +++ b/docker-test-server/nginx.conf @@ -0,0 +1,30 @@ +events { + worker_connections 1024; +} + +http { + upstream spring-app { + server server1:8080; # 컨테이너 내부 포트 사용 + server server2:8080; + server server3:8080; + } + + server { + listen 8080; + + location / { + proxy_pass http://spring-app; + 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; + + proxy_connect_timeout 300; + proxy_send_timeout 300; + proxy_read_timeout 300; + proxy_buffers 4 256k; + proxy_buffer_size 128k; + proxy_busy_buffers_size 256k; + } + } +} \ No newline at end of file diff --git a/docker-test-server/src/main/java/com/example/server/controller/ToothController.java b/docker-test-server/src/main/java/com/example/server/controller/ToothController.java index 38edc72..889fe77 100644 --- a/docker-test-server/src/main/java/com/example/server/controller/ToothController.java +++ b/docker-test-server/src/main/java/com/example/server/controller/ToothController.java @@ -35,7 +35,7 @@ public class ToothController { private final JwtTokenService jwtTokenService; private final InvalidTokenService invalidTokenService; private final ToothService toothService; - private final Double totalCnt = 500.0; + private final Double totalCnt = 8.0; @PostMapping("") public ResponseEntity mypageGetinfo diff --git a/docker-test-server/src/main/java/com/example/server/jwt/JwtTokenService.java b/docker-test-server/src/main/java/com/example/server/jwt/JwtTokenService.java index de349e0..e49cc2f 100644 --- a/docker-test-server/src/main/java/com/example/server/jwt/JwtTokenService.java +++ b/docker-test-server/src/main/java/com/example/server/jwt/JwtTokenService.java @@ -9,17 +9,19 @@ import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.interfaces.DecodedJWT; +import io.github.cdimascio.dotenv.Dotenv; import lombok.extern.slf4j.Slf4j; @Slf4j @Service public class JwtTokenService { + Dotenv dotenv = Dotenv.configure().load(); + + private String secret = dotenv.get("JWT_SECRET_KEY"); - private String secret = System.getenv("JWT_SECRET_KEY"); - - private int accessTokenExpMinutes = 600 * 1000; // 10분 + private int accessTokenExpMinutes = 1728000 * 1000; // 10분 - private int refreshTokenExpMinutes = 1209600 * 1000; // 2주 + private int refreshTokenExpMinutes = 12096000 * 1000; // 2주 private final Algorithm algorithm = Algorithm.HMAC256(secret); diff --git a/docker-test-server/src/main/java/com/example/server/service/ToothService.java b/docker-test-server/src/main/java/com/example/server/service/ToothService.java index 440bfc3..1611410 100644 --- a/docker-test-server/src/main/java/com/example/server/service/ToothService.java +++ b/docker-test-server/src/main/java/com/example/server/service/ToothService.java @@ -24,8 +24,8 @@ public class ToothService { private void init() { toothPartEngToKor.put("UNDER_FRONT", "아랫쪽 앞니"); toothPartEngToKor.put("UP_FRONT", "윗쪽 앞니"); - toothPartEngToKor.put("UNDER_RIGHT_CANINE", "아래쪽 오른쪽 송곳니"); - toothPartEngToKor.put("UP_RIGHT_CANINE", "위쪽 오른쪽 송곳니"); + toothPartEngToKor.put("UNDER_RIGHT_CANINE", "아랫쪽 오른쪽 송곳니"); + toothPartEngToKor.put("UP_RIGHT_CANINE", "윗쪽 오른쪽 송곳니"); toothPartEngToKor.put("UNDER_RIGHT_MOLAR_OUTSIDE", "아랫쪽 오른쪽 어금니 바깥쪽"); toothPartEngToKor.put("UP_RIGHT_MOLAR_OUTSIDE", "윗쪽 오른쪽 어금니 바깥쪽"); toothPartEngToKor.put("UP_LEFT_MOLAR_CHEWING_SIDE", "윗쪽 왼쪽 어금니 씹는쪽"); @@ -45,7 +45,7 @@ public String toothPartEngToKorFunction(String englishPart) { public String evaluationPercentValue(Double percent) { if (100 == percent) return "적절해요."; - else if (70 <= percent) + else if (60 <= percent) return "주의해요."; return "미흡해요."; }