I am trying to make use of Tomcat's rewrite valve in my Spring Boot app however cannot determine where to put the rewrite.conf in order to be loaded successfully.
I am using Spring Boot 2.0.3.RELEASE with Tomcat 8.5.31 and packaging the application as a fat jar.
I have configured the rewrite valve like so:
@Bean
public TomcatServletWebServerFactory containerFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
factory.addContextValves(new RewriteValve());
return factory;
}
However, it appears to rely on a directory structure of /WEB-INF to load the rewrite.conf from, which being a fat jar, I don't currently have.
Has anybody found a solution to configure this without changing the application packaging structure to a WAR with a WEB-INF directory?