spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.53k stars 3.32k forks source link

How can i block"/actuator" endpoint in gateway #3374

Closed niteshk9894 closed 6 months ago

niteshk9894 commented 6 months ago

I wanted to know how can i block actuator endpoint in spring cloud gateway. Basically i want to block it for external access but internal pod to pod communication i want to allow it .

For example :

I created a routeLocator like below just example i

.route("generic_route", r -> r.order(0).path("/**").filters(f->f.filter(urlFilter)).uri("no://op"))

but it is not going through this filter or route.

hsb786 commented 6 months ago

You can specify the actuator's port separately

server: port: 5100 #service port management: server: port: 5200 #actuator port

niteshk9894 commented 6 months ago

I used webFilter then it works ...... Thanks for letting me know to run on diff port. https://github.com/spring-cloud/spring-cloud-gateway/issues/2784

niteshk9894 commented 6 months ago

issue resolved