Sample API gateway config using nginx and sample API to test
make up to start up services.make down to stop and remove services and associated resourcesmake help for guidanceNginx file config structure
etc/
└── nginx/
├── api_conf.d/ ………………………………… Subdirectory for per-API configuration
│ └── warehouse_api.conf …… Definition and policy of the Warehouse API
├── api_backends.conf ………………… The backend services (upstreams)
├── api_gateway.conf …………………… Top-level configuration for the API gateway server
├── api_json_errors.conf ………… HTTP error responses in JSON format
├── conf.d/
│ ├── ...
│ └── existing_apps.conf
└── nginx.conf
Test protected API
## curl -H "apikey: d2hvYW1pdGhlYmVzdHJhcHBlcg==" localhost/api/warehouse/hello
{"message":"hello dude"}
API gateway reference - https://www.nginx.com/blog/deploying-nginx-plus-as-an-api-gateway-part-1/
Content type
Image
Digest
Size
48.4 MB
Last updated
almost 7 years ago
docker pull drlatt/nginx-api-gateway