본문 바로가기
오류

MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled

by 신방동불주먹 2023. 7. 19.

원인

spring web security 적용 후 css, js 파일 적용이 안되는 문제. 

 

 

해결 방법

SecurityConfig 파일에서 js, css, image 설정은 보안설정 영향 밖에 있도록 설정해준다.

 

 @Bean
    public WebSecurityCustomizer configure() {
        return (web) -> web.ignoring().mvcMatchers(
                "/css/**",
                "/imgs/**",
                "/js/**"
        );
    }