I read How to shutdown a Spring Boot Application in a correct way?, so I try to use http shutdown endpoints to shutdown my spring boot embedded tomcat application.
But I need it to be accessed only by localhost so that nobody else will shutdown my applications.
I find I can use management.address=127.0.0.1
t not allow remote management connections.
But what if I need some endpoints like /health
, /info
still remote access available?
Is there a way to ONLY hook the shutdown endpoints so that I can check the requester ip?