The primary function of the API gateway is to provide a single, consistent entry point for multiple APIs, regardless of how they are implemented or deployed at the backend. Our API gateway needs to manage existing APIs, monoliths, and applications undergoing a partial transition to microservices.
To understand more about nginx api gateway, visit: Nginx API Gateway Documentation
└── certs/ ………………………………………………………………………… Certs file to allow ssl └── gateway_server/ ├── reponses/ ……………………………………………………… Subdirectory to record http responses. │ └── api_json_errors.conf ……………… Http error responses in JSON format mapped to be used by nginx. ├── services/ ……………………………………………………… Subdirectory to record http responses. │ └── *-services.conf …………………………… The backend services with location and proxy pass configurations. ├── api_gateway.conf …………………………………… Top-level configuration for the API gateway server. └── nginx.conf …………………………………………………… Nginx configuration, responsible to import all files.
- Clone the projec:
git clone git@github.com:larryrumson/nginx-gateway-api.git
- Go to the project paste:
cd nginx-gateway-api
- Building the docker image:
docker buid -t nginx-gateway-api .
- Run the nginx container detached mode:
This container will be running in port 5000 and the nginx is going to listen the same port.
docker run -d -p 5000:5000 nginx-gateway-api