For some reason, my spring boot war which I have deployed into tomcat is not serving request for the site root from index.html. (index.html is at the context root).
When I use an executable war, everything works fine - https://domain.tld automatically loads index.html. For some reason when I deploy the same war to tomcat, and navigate to https://domain.tld, I get Spring Boot's 404 page. Going to https://domain.tld/index.html works fine, though. I see "o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: ServletContext resource [/index.html]"
in the startup log for both the executable war and tomcat's log. However, in tomcat's access log, there is a 404 and no redirect: GET / HTTP/2.0" 404 286
My web.xml has the following, which doesn't appear to be overridden anywhere. (Fresh tomcat install)
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
Any ideas why there is different behavior, and how to fix it? I've been banging my head against this for most of the day with no luck.
Update 1
Turned on trace logging and found the point of divergence, but have no idea what it means:
Executable war (successful)
2020-09-23 01:34:21.348 TRACE 11076 --- [nio-8443-exec-3] o.s.web.servlet.DispatcherServlet : GET "/", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
2020-09-23 01:34:21.353 TRACE 11076 --- [nio-8443-exec-3] o.s.b.a.w.s.WelcomePageHandlerMapping : Mapped to HandlerExecutionChain with [ParameterizableViewController [view="forward:index.html"]] and 3 interceptors
2020-09-23 01:34:21.362 TRACE 11076 --- [nio-8443-exec-3] o.s.b.f.s.DefaultListableBeanFactory : Invoking afterPropertiesSet() on bean with name 'forward:'
2020-09-23 01:34:21.362 TRACE 11076 --- [nio-8443-exec-3] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'metaDataSourceAdvisor'
Tomcat (404)
2020-09-23 01:29:05.816 TRACE 10413 --- [apr-8443-exec-1] o.s.web.servlet.DispatcherServlet : GET "/", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
2020-09-23 01:29:05.818 TRACE 10413 --- [apr-8443-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]] and 3 interceptors
2020-09-23 01:29:05.818 DEBUG 10413 --- [apr-8443-exec-1] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found
2020-09-23 01:29:05.818 DEBUG 10413 --- [apr-8443-exec-1] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2020-09-23 01:29:05.818 TRACE 10413 --- [apr-8443-exec-1] o.s.web.servlet.DispatcherServlet : No view rendering, null ModelAndView returned.
2020-09-23 01:29:05.818 DEBUG 10413 --- [apr-8443-exec-1] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND, headers={masked}