Skip to content

Commit 22581df

Browse files
committed
changed bullet
1 parent 43a3d5e commit 22581df

File tree

1 file changed

+1
-101
lines changed

1 file changed

+1
-101
lines changed

content/waf/configure/nginx-features.md

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ It is intended as a reference for small, self-contained examples of how F5 WAF f
1717

1818
Important constraints when F5 WAF for NGINX is enabled:
1919

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.
20+
- Subrequest-based modules (modules that create internal HTTP subrequests) are not supported in the same configuration scope as **app_protect_enable on**. F5 WAF for NGINX inspects only the client-facing request in the scope where it is enabled; internal subrequests fall outside that scope and are not inspected.
2121
- 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.
2222

2323
For additional information on configuring NGINX, you should view the [NGINX documentation]({{< ref "/nginx/" >}}).
@@ -148,106 +148,6 @@ http {
148148
}
149149
```
150150

151-
### Enable WAF on an njs module using the subrequest mechanism
152-
153-
This configuration example shows how to enable WAF on an njs module that relies on the subrequest mechanism.
154-
155-
{{< tabs name="subrequest-example" >}}
156-
157-
{{% tab name="nginx.conf" %}}
158-
159-
```nginx
160-
user nginx;
161-
worker_processes auto;
162-
163-
events {
164-
worker_connections 1024;
165-
}
166-
167-
load_module modules/ngx_http_app_protect_module.so;
168-
load_module modules/ngx_http_js_module.so;
169-
170-
http {
171-
include /etc/nginx/mime.types;
172-
default_type application/octet-stream;
173-
sendfile on;
174-
keepalive_timeout 65;
175-
js_import main from example.js;
176-
177-
server {
178-
listen 80;
179-
server_name localhost;
180-
proxy_http_version 1.1;
181-
app_protect_enable on;
182-
183-
location / {
184-
proxy_pass http://127.0.0.1:8080/foo/$request_uri;
185-
}
186-
}
187-
server {
188-
listen 127.0.0.1:8080;
189-
server_name localhost;
190-
proxy_http_version 1.1;
191-
192-
location /foo {
193-
js_content main.fetch_subrequest;
194-
}
195-
196-
location / {
197-
internal;
198-
return 200 "Hello! I got your URI request - $request_uri\n";
199-
}
200-
}
201-
}
202-
```
203-
204-
{{% /tab %}}
205-
206-
{{% tab name="example.js" %}}
207-
208-
```js
209-
async function fetch_subrequest(r) {
210-
let reply = await r.subrequest('/<script>');
211-
let response = {
212-
uri: reply.uri,
213-
code: reply.status,
214-
body: reply.responseText,
215-
};
216-
r.return(200, JSON.stringify(response));
217-
}
218-
219-
export default {join};
220-
```
221-
222-
{{% /tab %}}
223-
224-
{{< /tabs >}}
225-
226-
If the njs handler triggers an internal subrequest to `/<script>`, it is not inspected by F5 WAF for NGINX and succeeds:
227-
228-
```shell
229-
curl "localhost/"
230-
```
231-
232-
```text
233-
{"uri":"/<script>","code":200,"body":"Hello! I got your URI request - /foo//\n"}
234-
235-
```
236-
237-
However, if a direct, client-facing request attempts to trigger the same URL, it is inspected by F5 WAF for NGINX and is blocked according to the security policy.
238-
239-
```shell
240-
curl "localhost/<script>"
241-
```
242-
243-
```text
244-
<html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.
245-
246-
Your support ID is: 123456789
247-
248-
<a href='javascript:history.back();'>[Go Back]</a></body></html>
249-
```
250-
251151
## Range header–dependent modules
252152

253153
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.

0 commit comments

Comments
 (0)