2 回答

TA貢獻(xiàn)1816條經(jīng)驗(yàn) 獲得超4個(gè)贊
這是一個(gè)代理問題,我只需在我的 application.properties 中添加以下行
server.tomcat.remote-ip-header=x-forwarded-for server.tomcat.protocol-header=x-forwarded-proto

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超6個(gè)贊
嘗試顯式啟用HSTS:
protected void configure(HttpSecurity http) throws Exception {
? ? http
? ? ? ? .headers()
? ? ? ? ? ? .hsts()
? ? ? ? .authorizeRequests()
? ? ? ? ? ? .antMatchers("/", "/home", "/status", "/actuator").permitAll()
? ? ? ? ? ? .anyRequest().authenticated()
? ? ? ? ? ? .and()
? ? ? ? .formLogin()
? ? ? ? ? ? .permitAll()
? ? ? ? ? ? .and()
? ? ? ? .logout()
? ? ? ? ? ? .permitAll()
? ? ? ? ? ? .and()
? ? ? ? .csrf()
? ? ? ? ? ? .disable();
}
添加回答
舉報(bào)