You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-34Lines changed: 20 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,18 @@
1
1
# NGINX-Declarative-API
2
2
3
-
This tool provides a set of declarative REST API for NGINX Instance Manager.
3
+
This project provides a set of declarative REST API for [NGINX Instance Manager](https://docs.nginx.com/nginx-management-suite/nim/).
4
4
5
5
It can be used to manage NGINX Plus configuration lifecycle and to create NGINX Plus configurations using JSON service definitions.
6
6
7
-
GitOps integration is supported when used with NGINX Instance Manager: source of truth is checked for updates (NGINX App Protect policies, TLS certificates, keys and chains/bundles) and NGINX configurations are automatically kept in sync.
7
+
GitOps integration is supported when used with NGINX Instance Manager: source of truth is checked for updates (NGINX App Protect policies, TLS certificates, keys and chains/bundles, Swagger/OpenAPI definitions) and NGINX configurations are automatically kept in sync.
8
8
9
9
Use cases include:
10
10
11
11
- Rapid configuration generation and templating
12
12
- CI/CD integration with NGINX Instance Manager (instance groups and staged configs)
13
13
- NGINX App Protect DevSecOps integration
14
14
- API Gateway deployments with automated Swagger / OpenAPI schemas import
15
+
- API Developer portals zero-touch deployment
15
16
- GitOps integration with source of truth support for
| NGINX App Protect WAF | Per-policy CRUD at `server` and `location` level with dataplane-based bundle compilation | Security policies can be dynamically fetched from source of truth |
92
-
| API Gateway | Swagger and OpenAPI YAML and JSON schema support | Automated configuration, HTTP methods and rate limiting enforcement |
92
+
| NGINX App Protect WAF | Per-policy CRUD at `server` and `location` level with dataplane-based bundle compilation | Security policies can be dynamically fetched from source of truth |
93
+
| API Gateway | Swagger and OpenAPI YAML and JSON schema support | Automated configuration, HTTP methods and rate limiting enforcement |
94
+
| API Developer Portal | Swagger and OpenAPI YAML and JSON schema support | Based on Redocly |
93
95
94
96
## How to use
95
97
@@ -99,42 +101,26 @@ Usage details and JSON schema are available here:
99
101
100
102
A sample Postman collection and usage instructions can be found [here](/contrib/postman)
101
103
102
-
### Using docker-compose
104
+
##How to run
103
105
104
-
This is the recommended method to run NGINX Declarative API on a Linux virtual machine. Refer to [installation instructions](https://github.com/fabriziofiorucci/NGINX-Declarative-API/tree/main/contrib/docker-compose)
106
+
Docker-compose is the recommended method to run NGINX Declarative API on a Linux virtual machine. Full details are available [here](https://github.com/fabriziofiorucci/NGINX-Declarative-API/tree/main/contrib/docker-compose)
105
107
106
-
### As a Python application
108
+
##Building Docker images
107
109
108
-
This repository has been tested with and requires Python 3.9 or newer.
109
-
A running instance of [redis](https://redis.io/) is required: redis host and port can be configured in the `config.toml` file.
$ docker run --name nginx-declarative-api -d -p 5000:5000 nginx-declarative-api:latest
129
-
```
130
-
131
-
Pre-built docker images are available on Docker Hub at https://hub.docker.com/repository/docker/fiorucci/nginx-declarative-api/general and can be run using:
docker run --name devportal -d -p 5001:5000 fiorucci/nginx-declarative-api-devportal
136
121
137
-
Pre-built images are configured to access the redis instance on host:port`127.0.0.1:6379`. This can be changed by mounting a custom `config.toml` file on the `nginx-declarative-api` container.
122
+
Pre-built docker images are available on Docker Hub at https://hub.docker.com/repository/docker/fiorucci/nginx-declarative-api/general
123
+
Configuration can be customized mounting `config.toml` as a volume `nginx-declarative-api` docker image as a volume to customize
Copy file name to clipboardExpand all lines: USAGE-v3.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,13 +53,16 @@ Locations `.declaration.http.servers[].locations[].uri` match modifiers in `.dec
53
53
54
54
### API Gateway ###
55
55
56
-
Swagger files and OpenAPI schemas can be used to automatically configure NGINX as an API Gateway.
56
+
Swagger files and OpenAPI schemas can be used to automatically configure NGINX as an API Gateway. Developer portal creation is supported through [Redocly](https://redocly.com/)
57
57
58
58
Declaration path `.declaration.http.servers[].locations[].apigateway` defines the API Gateway configuration:
59
59
60
60
-`openapi_schema` - the base64-encoded schema, or the schema URL. YAML and JSON are supported
61
-
-`strip_uri` - removes the `.declaration.http.servers[].locations[].uri` part of the URI before forwarding requests to the upstream
62
-
-`server_url` - the base URL of the upstream server
61
+
-`api_gateway.enabled` - enable/disable API Gateway provisioning
62
+
-`api_gateway.strip_uri` - removes the `.declaration.http.servers[].locations[].uri` part of the URI before forwarding requests to the upstream
63
+
-`api_gateway.server_url` - the base URL of the upstream server
-`developer_portal.uri` - the trailing part of the Developer portal URI, this is appended to `.declaration.http.servers[].locations[].uri`. If omitted it defaults to `devportal.html`
63
66
-`rate_limit` - optional, used to enforce rate limiting at the API Gateway level
64
67
65
68
A sample API Gateway declaration to publish the `https://petstore.swagger.io` REST API and enforce:
0 commit comments