BLUE
Profile banner
DL
David Lins
@davidlins.bsky.social
BJJ & Code
215 followers253 following120 posts
DLdavidlins.bsky.social

Desafio 3: Até ai estava rodando a aplicação pelo Spring Boot e não pelo wildfly, ao tentar rodar pelo wildfly não subia pois o tomcat estava subindo junto. Solução: Remover o tomcat no maven e já removi o logback tb pois o wildfly tem seu esquema de configuração de logs.

Maven:  <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
1

DLdavidlins.bsky.social

Desafio 4: Após subir no wildfly, voltou o problema de https para https, por algum motivo o spring boot subia ForwardedHeaderFilter que pegava o header injetados pelo nginx Solução: Cria um bean org.springframework.web.filter.ForwardedHeaderFilter

code: 
 @Bean
    FilterRegistrationBean<ForwardedHeaderFilter> forwardedHeaderFilter() {
        ForwardedHeaderFilter filter = new ForwardedHeaderFilter();
        FilterRegistrationBean<ForwardedHeaderFilter> registration = new FilterRegistrationBean<>(filter);
        registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ASYNC, DispatcherType.ERROR);
        registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
        registration.setUrlPatterns(List.of("/"));
        return registration;
    }
1
Profile banner
DL
David Lins
@davidlins.bsky.social
BJJ & Code
215 followers253 following120 posts