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
* 20240701 - dev NGINX App Protect 5 compiler
* 20240701 - dev NGINX App Protect 5 compiler
* 20240730 - v5.1 dev
* 2024073002 - v5.1 dev
* 2024073003 dev 5.1
* 20240731 - 5.1 dev
* 2024080201 - 5.1 dev
* 20240806 - 5.1 dev
Moved resolvers config to include files
Added per-upstream resolver support
FEATURES updated
* 2024080602 - 5.1 dev
Moved HTTP upstreams to separate include files
Bugfixes
Updated postman collection
* 20240807 - 5.1 dev
Moved HTTP and Stream upstream to separated include config file
Added DNS resolver support for stream servers and stream upstreams
Moved .declaration.http.resolvers[] to .declaration.resolvers[]
Postman collection updated for v5.1
* 2024080801 - 5.1 dev
Postman collection updated
NGINX One REST API endpoints updated
* 2024080809 - 5.1 dev
FEATURES updated
Postman collection README updated
API v5.1 USAGE updated
* 2024080902 - 5.1 dev
FEATURES updated
* 2024080903 - 5.1 dev
Copy file name to clipboardexpand all lines: README.md
+11-24
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,18 @@
2
2
3
3
[](https://www.repostatus.org/#active)
4
4
5
-
This project provides a set of declarative REST API for [NGINX Instance Manager](https://docs.nginx.com/nginx-management-suite/nim/) and [NGINX One Cloud Console](https://docs.nginx.com/nginx-one/) (currently in early stage).
5
+
This project provides a set of declarative REST API for [NGINX Instance Manager](https://docs.nginx.com/nginx-management-suite/nim/) and [NGINX One Cloud Console](https://docs.nginx.com/nginx-one/) (currently in early stage / unstable).
6
6
7
7
It can be used to manage NGINX Plus configuration lifecycle and to create NGINX Plus configurations using JSON service definitions.
8
8
9
9
GitOps integration is supported: source of truth is checked for updates (NGINX App Protect policies, TLS certificates, keys and chains/bundles, Swagger/OpenAPI definitions, snippets) and NGINX configurations are automatically kept in sync.
10
10
11
11
Use cases include:
12
12
13
-
- Rapid configuration generation and templating
14
-
- CI/CD integration with NGINX Instance Manager (instance groups and staged configs) and NGINX One Cloud Console (clusters)
13
+
- Integration with NGINX Instance Manager (instance group) and NGINX One Cloud Console (config sync group)
-[NGINX One Cloud Console](https://docs.nginx.com/nginx-one/)
6
+
-[NGINX One Cloud Console](https://docs.nginx.com/nginx-one/) - early stage / unstable
7
7
-[NGINX Plus](https://docs.nginx.com/nginx/) R30+
8
-
-[NGINX App Protect WAF](https://docs.nginx.com/nginx-app-protect-waf/) 4.2.0+ with compiled[policy bundles](https://docs.nginx.com/nginx-app-protect-waf/v5/admin-guide/compiler/)
8
+
-[NGINX App Protect WAF](https://docs.nginx.com/nginx-app-protect-waf/) 4 with precompiled[policy bundles](https://docs.nginx.com/nginx-app-protect-waf/v5/admin-guide/compiler/)
9
9
10
-
The JSON schema is self explanatory. See also the [sample Postman collection](/contrib/postman)
10
+
The JSON schema is self explanatory. See also the [sample Postman collection](/contrib/postman) for usage examples
11
11
12
12
-`.output.type` defines how NGINX configuration will be returned:
13
-
-*plaintext* - plaintext format
14
-
-*json* - JSON-wrapped, base64-encoded
15
-
-*configmap* - Kubernetes Configmap in YAML format.
16
-
-`.output.configmap.name` must be set to the ConfigMap name
17
-
-`.output.configmap.filename` must be set to the NGINX configuration filename
18
-
-`.output.configmap.namespace` the optional namespace for the ConfigMap
19
-
-*http* - NGINX configuration is POSTed to custom url
20
-
-`.output.http.url` the URL to POST the configuration to
21
13
-*nms* - NGINX configuration is published as a Staged Config to NGINX Instance Manager
22
14
-`.output.nms.url` the NGINX Instance Manager URL
23
15
-`.output.nms.username` the NGINX Instance Manager authentication username
@@ -38,165 +30,23 @@ The JSON schema is self explanatory. See also the [sample Postman collection](/c
38
30
-`.output.nms.policies[].versions[].displayName` the policy version's display name
39
31
-`.output.nms.policies[].versions[].description` the policy version's description
40
32
-`.output.nms.policies[].versions[].contents` this can be either base64-encoded or be a HTTP(S) URL that will be fetched dynamically from a source of truth
41
-
-*nginxone* - NGINX configuration is published to a NGINX One Cloud Console cluster
33
+
-*nginxone* - NGINX configuration is published to a NGINX One Cloud Console config sync group
42
34
-`.output.nginxone.url` the NGINX One Cloud Console URL
43
35
-`.output.nginxone.namespace` the NGINX One Cloud Console namespace
44
36
-`.output.nginxone.token` the authentication token
45
-
-`.output.nginxone.cluster` the cluster name
37
+
-`.output.nginxone.configsyncgroup` the NGINX One Cloud Console config sync group name
46
38
-`.output.nginxone.synctime`**optional**, used for GitOps autosync. When specified and the declaration includes HTTP(S) references to NGINX App Protect policies, TLS certificates/keys/chains, the HTTP(S) endpoints will be checked every `synctime` seconds and if external contents have changed, the updated configuration will automatically be published to NGINX One Cloud Console
47
39
-`.output.nginxone.modules` an optional array of NGINX module names (ie. 'ngx_http_app_protect_module', 'ngx_http_js_module','ngx_stream_js_module')
48
40
-`.output.nginxone.certificates` an optional array of TLS certificates/keys/chains to be published
49
41
-`.output.nginxone.certificates[].type` the item type ('certificate', 'key', 'chain')
50
42
-`.output.nginxone.certificates[].name` the certificate/key/chain name with no path/extension (ie. 'test-application')
51
43
-`.output.nginxone.certificates[].contents` the content: this can be either base64-encoded or be a HTTP(S) URL that will be fetched dynamically from a source of truth
52
-
-`.declaration` describes the NGINX configuration to be created.
44
+
-`.declaration` describes the NGINX configuration to be created
-`.declaration.resolvers[]` DNS resolvers definitions
53
48
54
-
### Locations ###
55
-
56
-
Locations `.declaration.http.servers[].locations[].uri` match modifiers in `.declaration.http.servers[].locations[].urimatch` can be:
57
-
58
-
-*prefix* - prefix URI matching
59
-
-*exact* - exact URI matching
60
-
-*regex* - case sensitive regex matching
61
-
-*iregex* - case insensitive regex matching
62
-
-*best* - case sensitive regex matching that halts any other location matching once a match is made
63
-
64
-
### Javascript profiles ###
65
-
66
-
NGINX Javascript profiles are defined in `.declaration.http.njs[]`:
67
-
68
-
-`name` - the NJS profile name
69
-
-`file.content` - the base64-encoded njs source code or the `http(s)://` URL of the file
70
-
-`file.authentication.server[0].profile` - authentication profile name if `file.content` is a URL and the request must be authenticated
71
-
72
-
### Javascript hooks ###
73
-
74
-
NGINX Javascript hooks can be used in:
75
-
76
-
-`.declaration.http.njs`
77
-
- Supported hooks:
78
-
- `js_preload_object'
79
-
- 'js_set`
80
-
-`.declaration.http.server[].njs`
81
-
- Supported hooks:
82
-
- `js_preload_object'
83
-
- 'js_set`
84
-
-`.declaration.http.server[].location[].njs`
85
-
- Supported hooks:
86
-
- `js_body_filter'
87
-
- 'js_content'
88
-
- 'js_header_filter'
89
-
- 'js_periodic'
90
-
- 'js_preload_object'
91
-
- 'js_set`
92
-
93
-
Hooks invocation is:
94
-
95
-
```
96
-
"njs": [
97
-
{
98
-
"hook": {
99
-
"name": "<HOOK_NAME>",
100
-
"parameters": [
101
-
{
102
-
"name": "<HOOK_PARAMETER_NAME>",
103
-
"value": "<HOOK_PARAMETER_VALUE>"
104
-
}
105
-
]
106
-
},
107
-
"profile": "<NGINX_JAVASCRIPT_PROFILE>",
108
-
"function": "<JAVASCRIPT_FUNCTION_NAME>"
109
-
}
110
-
]
111
-
```
112
-
113
-
For detailed examples see the [Postman collection](/contrib/postman)
114
-
115
-
### API Gateway ###
116
-
117
-
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/)
118
-
119
-
Declaration path `.declaration.http.servers[].locations[].apigateway` defines the API Gateway configuration:
120
-
121
-
-`openapi_schema` - the base64-encoded schema, or the schema URL. YAML and JSON are supported
122
-
-`api_gateway.enabled` - enable/disable API Gateway provisioning
123
-
-`api_gateway.strip_uri` - removes the `.declaration.http.servers[].locations[].uri` part of the URI before forwarding requests to the upstream
124
-
-`api_gateway.server_url` - the base URL of the upstream server
-`authentication.enforceOnPaths` - if set to `true` authentication is enforced on all API endpoints listed under `authentication.paths`. if set to `false` authentication is enforced on all API endpoints but those listed under `authentication.paths`
132
-
-`authentication.paths` - paths to enforce authentication
133
-
-`authorization[]` - optional, used to enforce authorization
134
-
-`authorization[].profile` - authorization profile name
135
-
-`authorization[].enforceOnPaths` - if set to `true` authorization is enforced on all API endpoints listed under `authorization.paths`. if set to `false` authorization is enforced on all API endpoints but those listed under `authorization[].paths`
136
-
-`authorization[].paths` - paths to enforce authorization
137
-
-`rate_limit` - optional, used to enforce rate limiting at the API Gateway level
138
-
-`rate_limit.enforceOnPaths` - if set to `true` rate limiting is enforced on all API endpoints listed under `rate_limit.paths`. if set to `false` rate limiting is enforced on all API endpoints but those listed under `rate_limit.paths`
139
-
140
-
A sample API Gateway declaration to publish the `https://petstore.swagger.io` REST API using:
141
-
142
-
- REST API endpoint URIs
143
-
- HTTP Methods
144
-
- Rate limiting on `/user/login`, `/usr/logout` and `/pet/{petId}/uploadImage`
145
-
- JWT authentication on `/user/login`, `/usr/logout` and `/pet/{petId}/uploadImage`
146
-
- JWT claim-based authorization on `/user/login`, `/usr/logout` and `/pet/{petId}/uploadImage`
147
-
- Redocly-based developer portal
148
-
- NGINX App Protect WAF security
149
-
150
-
can be found in the [Postman collection](/contrib/)
151
-
152
-
### Maps ###
153
-
154
-
Map entries `.declaration.maps[].entries.keymatch` can be:
155
-
156
-
-*exact* - exact variable matching
157
-
-*regex* - case sensitive regex matching
158
-
-*iregex* - case insensitive regex matching
159
-
160
-
### Snippets ###
161
-
162
-
Snippets for `http`, `upstream`, `server` and `location` can be specified as:
163
-
- base64-encoded content
164
-
- HTTP(S) URL of a source of truth to fetch snippet content from. Content on the source of truth must be plaintext
165
-
- source of truth authentication is supported through authentication profiles
166
-
167
-
### Authentication profiles ###
168
-
169
-
Client and Server authentication profiles can be defined in the declarative json at `.declaration.http.authentication`
170
-
171
-
```commandline
172
-
"authentication": {
173
-
"client": [
174
-
{
175
-
"name": "<PROFILE_NAME>",
176
-
"type": "<PROFILE_TYPE>",
177
-
"<PROFILE_TYPE>": {
178
-
"<PROFILE_KEY>": "<VALUE>",
179
-
[...]
180
-
}
181
-
},
182
-
[...]
183
-
],
184
-
"server": [
185
-
{
186
-
"name": "<PROFILE_NAME>",
187
-
"type": "<PROFILE_TYPE>",
188
-
"<PROFILE_TYPE>": {
189
-
"<PROFILE_KEY>": "<VALUE>",
190
-
[...]
191
-
}
192
-
},
193
-
[...]
194
-
]
195
-
```
196
-
197
-
For a list of all supported authentication profile types see the [feature matrix](/FEATURES.md)
198
-
199
-
### API endpoints ###
49
+
### API endpoints
200
50
201
51
-`POST /v5.1/config/` - Publish a new declaration
202
52
-`PATCH /v5.1/config/{config_uid}` - Update an existing declaration
@@ -206,8 +56,4 @@ For a list of all supported authentication profile types see the [feature matrix
206
56
- Per-Stream upstream CRUD
207
57
- Per-NGINX App Protect WAF policy CRUD
208
58
-`GET /v5.1/config/{config_uid}` - Retrieve an existing declaration
209
-
-`DELETE /v5.1/config/{config_uid}` - Delete an existing declaration
210
-
211
-
### Usage Examples ###
212
-
213
-
A sample Postman collection is available [here](/contrib/postman)
59
+
-`DELETE /v5.1/config/{config_uid}` - Delete an existing declaration
0 commit comments