Search code examples
securitymicroservicesfirewallkongapi-gateway

Disable Microservice initial exposed port after configuring it in a gateway


Hello I've been searching everywhere and did not found a solution to my problem, which is how can I access my API through the gateway configured endpoint only, currently I can access to my api using localhost:9000, and localhost:8000 which is the Kong gateway port, that I secured and configured, but what's the point of using this gateway if the initial port is still accessible. Thus I am wondering is there a way to disable the 9000 port and only access to my API with KONG.


Solution

  • Thanks for the answers they give a different perspectives, but since I have a scalla/play microservice, I added a special Playframework built-in http filter in my application.conf and then allowing only the Kong gateway, now when trying to access my application by localhost:9000 I get denied, and that's absolutely what I was looking for.

    hope this answer gonna be helpful for future persons in this same situation.