In application.properties, set server.servlet.path=/spring
Now notice that EndpointRequest.* doesn't match anything. For example, a request for /spring/actuator/health doesn't match (a request for /actuator/health does match, though - even though it will return a 404).