SpringBootAdmin Posted on 2021-11-16 | In Spring | spring-boot-admin-server 어드민 서버 그래들 12345implementation("org.springframework.boot:spring-boot-starter-security:2.5.6") // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web implementation("org.springframework.boot:spring-boot-starter-web:2.5.6") // https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-server implementation("de.codecentric:spring-boot-admin-starter-server:2.5.4") 메인 메서드 어노테이션 추가 1@EnableAdminServer 시큐리티 설정 123456789101112131415161718192021222324252627282930313233 @Configuration class SecurityConfig : WebSecurityConfigurerAdapter() { var adminServerProperties = AdminServerProperties(); override fun configure(http: HttpSecurity?) { val contextPath = this.adminServerProperties.contextPath val successHandler = SavedRequestAwareAuthenticationSuccessHandler() successHandler.setTargetUrlParameter("redirectTo") successHandler.setDefaultTargetUrl("/") http!!.authorizeRequests() .antMatchers("$contextPath/assets/**").permitAll() .antMatchers("$contextPath/login").permitAll() .antMatchers(HttpMethod.GET, "/actuator/**").permitAll() .anyRequest().authenticated() .and() .formLogin().loginPage("$contextPath/login").successHandler(successHandler) .and() .logout().logoutUrl("$contextPath/logout") .and() .httpBasic() .and() .csrf() .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) .ignoringAntMatchers( "$contextPath/instances", "$contextPath/actuator/**" ) } } yml 1234567891011server: port: 50000 spring: security: user: name: admin password: admin #boot: # admin: # ui: # public-url: https://gorani.wecruitpro.com:443/ # 프록시 사용하는 경우 관리하는 프로젝트 yml 12345678910111213141516management: endpoints: web: exposure: include: '*' endpoint: health: show-details: always spring: boot: admin: client: auto-registration: 'true' password: admin url: http://localhost:50000 # admin url username: admin 그래들 1234// https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-client implementation 'de.codecentric:spring-boot-admin-starter-client:2.5.4' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-actuator' SpringBootAdmin