From b18cf97f8bea5da890eb6ea6fabcf3365bcc988a Mon Sep 17 00:00:00 2001 From: hann Date: Tue, 9 Jan 2024 11:28:36 +0900 Subject: [PATCH] [Refactor] NGINX set ref1 --- scripts/start.sh | 5 ++--- .../com/example/waggle/global/config/SecurityConfig.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index 5a99c89f..ce119570 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -8,9 +8,8 @@ source ${ABSDIR}/profile.sh # 해당 코드로 profile.sh 내의 함수 사용 REPOSITORY=/home/ec2-user/app/step3 echo ">>> Build 파일 복사" -echo ">>> cp $REPOSITORY/zip/build/libs/*.jar $REPOSITORY/" +cp $REPOSITORY/zip/*.jar $REPOSITORY/ -cp $REPOSITORY/zip/build/libs/*.jar $REPOSITORY/ echo ">>> 새 어플리케이션 배포" JAR_NAME=$(ls -tr $REPOSITORY/*.jar | tail -n 1) # jar 이름 꺼내오기 @@ -27,6 +26,6 @@ IDLE_PROFILE=$(find_idle_profile) echo ">>> $JAR_NAME 를 profile=$IDLE_PROFILE 로 실행합니다." nohup java -jar \ - -Dspring.config.location=classpath:/application.yml,/home/ec2-user/app/application-security.yml,/home/ec2-user/app/application-s3.yml,/home/ec2-user/app/application-real-db.yml,classpath:/application-real.yml, classpath:/application-real1.yml, classpath:/application-real2.yml \ + -Dspring.config.location=classpath:/application.yml,/home/ec2-user/app/application-security.yml,/home/ec2-user/app/application-s3.yml,/home/ec2-user/app/application-real-db.yml,classpath:/application-real.yml,classpath:/application-$IDLE_PROFILE.yml \ -Dspring.profiles.active=$IDLE_PROFILE \ $JAR_NAME > $REPOSITORY/nohup.out 2>&1 & \ No newline at end of file diff --git a/src/main/java/com/example/waggle/global/config/SecurityConfig.java b/src/main/java/com/example/waggle/global/config/SecurityConfig.java index 15254179..3e9ef7f4 100644 --- a/src/main/java/com/example/waggle/global/config/SecurityConfig.java +++ b/src/main/java/com/example/waggle/global/config/SecurityConfig.java @@ -95,7 +95,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti // SWAGGER .requestMatchers("/swagger-ui/**", "/swagger-resources/**", "/v3/api-docs/**").permitAll() //profile - .requestMatchers("/api/profiles").permitAll() + .requestMatchers("/profile").permitAll() // ELSE //정적 페이지 허가 .requestMatchers("/", "/css/**", "/*.ico", "/error", "/images/**").permitAll() // 임시로 모든 API 허용