Spring Boot – health 활성화

By | 2026년 2월 5일
Table of Contents

Spring Boot – health 활성화

의존성 추가

implementation 'org.springframework.boot:spring-boot-starter-actuator'

엔드포인트 노출

management:
  endpoints:
    web:
      exposure:
        include: "health"

Security 설정

@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
@EnableMethodSecurity(securedEnabled = true)
public class SecurityConfig {

    private final JwtAuthenticationFilter jwtAuthenticationFilter;
    private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
    private final CustomAccessDeniedHandler customAccessDeniedHandler;

    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http
                .authorizeHttpRequests(authz -> authz
                        .requestMatchers("/actuator/health").permitAll()
                );

        return http.build();
    }
}

확인하기

도메인과 포트는 서버 설정에서 확인해서 수정합니다.

http://localhost:8080/actuator/health

답글 남기기