I added an connector for AJP to my spring boot 2 project
@Bean
public ServletWebServerFactory servletContainer() {
TomcatServletWebServerFactory tomcat
This works for me:
@Bean
public WebServerFactoryCustomizer servletContainer() {
return server -> {
if (server instanceof TomcatServletWebServerFactory) {
((TomcatServletWebServerFactory) server).addAdditionalTomcatConnectors(redirectConnector());
}
};
}
private Connector redirectConnector() {
Connector connector = new Connector("AJP/1.3");
connector.setScheme("http");
connector.setPort(ajpPort);
connector.setSecure(false);
connector.setAllowTrace(false);
return connector;
}