6

I have a simple Spring Boot web app which is configured with @EnableAuthorizationServer. It is configured with server.context-path=/uaa and everything works as expected.

However, when I hit the app at the URL http://localhost, I get a 404. I want to redirect those requests to http://localhost/uaa.

I tried creating a Filter but even though it is initialized it is never called.

I also tried overriding the EmbeddedServletContainerCustomizer but is only seems to get called if I hit a 404 under the /uaa context.

What is the correct way to achieve this redirection from / (http://localhost/) to /uaa (http://localhost/uaa)?

Prakash K
  • 11,669
  • 6
  • 51
  • 109
Michael P.
  • 651
  • 5
  • 8
  • See https://stackoverflow.com/questions/63269328/in-spring-boot-how-do-i-redirect-outside-of-the-context-path It's a duplicate but with some answers – leo Nov 15 '22 at 21:08

1 Answers1

-3

Set server.context-path=/uaa in the application.properties.

Axel
  • 3,331
  • 11
  • 35
  • 58
  • 2
    this is not an answer to the question. OP is asking about redirecting not how to set a custom context-path. – Prakash K Mar 27 '18 at 11:47