I want to change context path for spring boot 2 for example i want to serve on http://localhost:8080/test/
i mean it not working for me with spring-boot-starter-webflux:2.0.0.RELEASE
it only working with spring-boot-starter-web::2.0.0.RELEASE
I have tried
server.servlet.context-path=/test
But nothing happened to me still serve on url http://localhost:8080/
If you use the servlet API then the property is now called
As confirmed by Andy Wilkinson @andy-wilkinson of the Spring Boot team via Gitter
i.e WebFlux doesn't support context path configuration
In reference to Spring Boot 2.x. below configuration apply for application.yml
For application.properties configuration are
For use cases where WebFlux application is behind load balancer/proxy you can use dedicated class -
ForwardedHeaderTransformer
that will extract path context fromX-Forwarded-Prefix
and will add it toServerHttpRequest
.Doing so you won't need to modify global context-path (which does not make sense in WebFlux)
More about it here: https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-web-handler-api