Skip to content

Commit 70c7690

Browse files
committed
feat: Add NGINX configuration step for VE
1 parent 8aaa5e4 commit 70c7690

File tree

3 files changed

+127
-1
lines changed

3 files changed

+127
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
nd-docs:
3+
---
4+
5+
```nginx
6+
server {
7+
listen 80;
8+
server_name domain.com;
9+
10+
proxy_http_version 1.1;
11+
12+
location / {
13+
14+
# NGINX App Protect WAF
15+
app_protect_enable on;
16+
17+
client_max_body_size 0;
18+
default_type text/html;
19+
proxy_pass http://127.0.0.1:8080/;
20+
}
21+
}
22+
23+
server {
24+
listen 8080;
25+
server_name localhost;
26+
27+
location / {
28+
root /usr/share/nginx/html;
29+
index index.html index.htm;
30+
}
31+
32+
# redirect server error pages to the static page /50x.html
33+
#
34+
error_page 500 502 503 504 /50x.html;
35+
location = /50x.html {
36+
root /usr/share/nginx/html;
37+
}
38+
}
39+
```
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
nd-docs:
3+
---
4+
5+
```nginx
6+
user nginx;
7+
worker_processes auto;
8+
9+
# NGINX App Protect WAF
10+
load_module modules/ngx_http_app_protect_module.so;
11+
12+
error_log /var/log/nginx/error.log notice;
13+
pid /var/run/nginx.pid;
14+
15+
events {
16+
worker_connections 1024;
17+
}
18+
19+
http {
20+
include /etc/nginx/mime.types;
21+
default_type application/octet-stream;
22+
23+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
24+
'$status $body_bytes_sent "$http_referer" '
25+
'"$http_user_agent" "$http_x_forwarded_for"';
26+
27+
access_log /var/log/nginx/access.log main;
28+
29+
sendfile on;
30+
#tcp_nopush on;
31+
32+
keepalive_timeout 65;
33+
34+
#gzip on;
35+
36+
# NGINX App Protect WAF
37+
app_protect_enforcer_address 127.0.0.1:50000;
38+
39+
include /etc/nginx/conf.d/*.conf;
40+
}
41+
```

content/waf/install/plus/virtual-environment.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,4 +354,50 @@ sudo dnf install app-protect-module-plus
354354

355355
{{< /tabs >}}
356356

357-
## Update configuration files
357+
## Update configuration files
358+
359+
Once you have installed F5 WAF for NGINX, you must load it as a module in the main context of your NGINX configuration.
360+
361+
```nginx
362+
load_module modules/ngx_http_app_protect_module.so;
363+
```
364+
365+
The Enforcer address must be added at the _http_ context:
366+
367+
```nginx
368+
app_protect_enforcer_address 127.0.0.1:50000;
369+
```
370+
371+
And finally, F5 WAF for NGINX can enabled on a _http_, _server_ or _location_ context:
372+
373+
```nginx
374+
app_protect_enable on;
375+
```
376+
377+
{{< call-out "warning" >}}
378+
379+
You should only enable F5 WAF for NGINX on _proxy_pass_ and _grpc_pass_ locations.
380+
381+
{{< /call-out >}}
382+
383+
Here are two examples of how these additions could look in configuration files:
384+
385+
{{<tabs name="example-configuration-files">}}
386+
387+
{{% tab name="nginx.conf" %}}
388+
389+
`/etc/nginx/nginx.conf`
390+
391+
{{< include "waf/nginx-conf-localhost.md" >}}
392+
393+
{{% /tab %}}
394+
395+
{{% tab name="default.conf" %}}
396+
397+
`/etc/nginx/conf.d/default.conf`
398+
399+
{{< include "waf/default-conf-localhost.md" >}}
400+
401+
{{%/tab%}}
402+
403+
{{< /tabs >}}

0 commit comments

Comments
 (0)