'how to make rest api private and just can called from api gateway server

How to make my rest api accessed from my api gateway only so another people cannot access directly

e.g:

curl http://ip:port/enpoint

so how to make that rest api just called from api gateway??

thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source