I deployed my spring boot webapp to Apache Tomcat. Apache Tomcat sits behind a httpd webserver. I want to access my webapp with www.mydomain.de
, which works fine for the most part. I achived this by using a VirtualHost with the following configuration:
ProxyPass / ajp://localhost:8011/mywebapp/
ProxyPassReverse / ajp://localhost:8011/mywebapp/
The webapp worked well to the point I added Spring Security authentication. When I click on a page which requires authentication, www.mydomain.de/mywebapp/login
is loaded. I want www.mydomain.de/login
Heres my Spring Security configuration:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/", "/index").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginProcessingUrl("/j_spring_security_check")
.loginPage("/login")
.defaultSuccessUrl("/")
.failureUrl("/login")
.usernameParameter("username")//
.passwordParameter("password")
.permitAll()
.and()
.logout()
.logoutUrl("/logout")
.invalidateHttpSession(true)
.permitAll();
}
How can I remove the webapp name in the URL?
Thank you!