Skip to content

Commit 87cbd14

Browse files
committed
doc: change the format
1 parent 3ed3e57 commit 87cbd14

File tree

1 file changed

+82
-61
lines changed

1 file changed

+82
-61
lines changed

content/waf/configure/nginx-features.md

Lines changed: 82 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,29 @@ nd-content-type: reference
1111
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
1212
nd-product: NAP-WAF
1313
---
14-
15-
This document shows example of how to modify your NGINX configuration to enable F5 WAF for NGINX features.
14+
This document shows examples of how to modify your NGINX configuration to enable F5 WAF for NGINX features.
1615

1716
It is intended as a reference for small, self-contained examples of how F5 WAF for NGINX can be configured.
1817

19-
Modules requiring the _Range_ header (Such as _Slice_) are unsupported in a scope which enables F5 WAF for NGINX. The examples below work around the contraints of these modules.
18+
Important constraints when F5 WAF for NGINX is enabled:
19+
20+
- Subrequest-based modules (NGINX modules that create internal HTTP subrequests) are not inspected in any scope block where __app_protect_enable on__ is set. F5 WAF for NGINX inspects only direct, client-facing HTTP requests.
21+
- Modules that require the HTTP Range header are not supported in the same configuration scope as __app_protect_enable on__. Place Range-dependent configuration in a server or location block without F5 WAF for NGINX enabled.
2022

2123
For additional information on configuring NGINX, you should view the [NGINX documentation]({{< ref "/nginx/" >}}).
2224

23-
## Internal subrequests
25+
## Subrequest-based modules
2426

25-
F5 WAF for NGINX will secure and inspect direct client-facing requests, but will not inspect internal subrequests triggered by modules.
27+
F5 WAF for NGINX inspects direct client-facing requests, but does not inspect internal subrequests generated by subrequest-based modules.
2628

27-
This applies to:
29+
Examples of subrequest-based modules:
2830

2931
* njs (r.subrequest)
3032
* Client authorization (auth_request)
3133
* Mirror (mirror)
3234
* SSI (virtual include)
3335

34-
The following example demonstrates the general rule:
36+
### Example
3537

3638
{{< tabs name="subrequest-example" >}}
3739

@@ -41,6 +43,10 @@ The following example demonstrates the general rule:
4143
user nginx;
4244
worker_processes auto;
4345
46+
events {
47+
worker_connections 1024;
48+
}
49+
4450
load_module modules/ngx_http_app_protect_module.so;
4551
load_module modules/ngx_http_js_module.so;
4652
@@ -125,59 +131,11 @@ Your support ID is: 123456789
125131
<a href='javascript:history.back();'>[Go Back]</a></body></html>
126132
```
127133

128-
## Static location
129-
130-
```nginx
131-
load_module modules/ngx_http_app_protect_module.so;
132-
133-
http {
134-
server {
135-
listen 127.0.0.1:8080;
136-
server_name localhost;
137-
138-
location / {
139-
app_protect_enable on;
140-
proxy_pass http://127.0.0.1:8080/proxy/$request_uri;
141-
}
142-
143-
location /proxy {
144-
default_type text/html;
145-
return 200 "Hello! I got your URI request - $request_uri\n";
146-
}
147-
}
148-
}
149-
```
150-
151-
## Range
152-
153-
```nginx
154-
load_module modules/ngx_http_app_protect_module.so;
155-
156-
http {
134+
### Additional subrequest-based examples
157135

158-
server {
159-
listen 127.0.0.1:8080;
160-
server_name localhost;
136+
These examples show other subrequest-based modules. In each case, internal subrequests are not inspected by WAF.
161137

162-
location / {
163-
app_protect_enable on;
164-
proxy_pass http://127.0.0.1:8081$request_uri;
165-
}
166-
}
167-
168-
server {
169-
listen 127.0.0.1:8081;
170-
server_name localhost;
171-
172-
location / {
173-
proxy_pass http://1.2.3.4$request_uri;
174-
proxy_force_ranges on;
175-
}
176-
}
177-
}
178-
```
179-
180-
## Slice
138+
#### Slice
181139

182140
```nginx
183141
load_module modules/ngx_http_app_protect_module.so;
@@ -206,7 +164,7 @@ http {
206164
}
207165
```
208166

209-
## Mirror
167+
#### Mirror
210168

211169
```nginx
212170
load_module modules/ngx_http_app_protect_module.so;
@@ -231,7 +189,7 @@ http {
231189
}
232190
```
233191

234-
## njs
192+
#### njs
235193

236194
```nginx
237195
load_module modules/ngx_http_app_protect_module.so;
@@ -261,7 +219,7 @@ http {
261219
}
262220
```
263221

264-
## Client authorization
222+
#### Client authorization
265223

266224
```nginx
267225
load_module modules/ngx_http_app_protect_module.so;
@@ -290,4 +248,67 @@ http {
290248
}
291249
}
292250
}
251+
```
252+
253+
## Range header–dependent modules
254+
255+
Features that add or depend on the HTTP Range header are unsupported in the same scope as __app_protect_enable__ on. Place Range-dependent logic in a separate scope that does not enable F5 WAF for NGINX, and have the F5 WAF for NGINX enable frontend proxy to that backend.
256+
257+
Examples of Range-dependent features:
258+
259+
- Static location
260+
- Range
261+
262+
### Additional range-based examples
263+
264+
### Static location
265+
266+
```nginx
267+
load_module modules/ngx_http_app_protect_module.so;
268+
269+
http {
270+
server {
271+
listen 127.0.0.1:8080;
272+
server_name localhost;
273+
274+
location / {
275+
app_protect_enable on;
276+
proxy_pass http://127.0.0.1:8080/proxy/$request_uri;
277+
}
278+
279+
location /proxy {
280+
default_type text/html;
281+
return 200 "Hello! I got your URI request - $request_uri\n";
282+
}
283+
}
284+
}
285+
```
286+
287+
### Range
288+
289+
```nginx
290+
load_module modules/ngx_http_app_protect_module.so;
291+
292+
http {
293+
294+
server {
295+
listen 127.0.0.1:8080;
296+
server_name localhost;
297+
298+
location / {
299+
app_protect_enable on;
300+
proxy_pass http://127.0.0.1:8081$request_uri;
301+
}
302+
}
303+
304+
server {
305+
listen 127.0.0.1:8081;
306+
server_name localhost;
307+
308+
location / {
309+
proxy_pass http://1.2.3.4$request_uri;
310+
proxy_force_ranges on;
311+
}
312+
}
313+
}
293314
```

0 commit comments

Comments
 (0)