@@ -26,4 +26,95 @@ You should only enable F5 WAF for NGINX on _proxy_pass_ and _grpc_pass_ location
2626
2727{{< /call-out >}}
2828
29- Here are two examples of how these additions could look in configuration files:
29+ Here are two examples of how these additions could look in configuration files:
30+
31+ {{< tabs name="configuration-examples" >}}
32+
33+ {{% tab name="nginx.conf" %}}
34+
35+ The default path for this file is ` _/etc/nginx/nginx.conf_ ` .
36+
37+ ``` nginx {hl_lines=[5, 33]}
38+ user nginx;
39+ worker_processes auto;
40+
41+ # F5 WAF for NGINX
42+ load_module modules/ngx_http_app_protect_module.so;
43+
44+ error_log /var/log/nginx/error.log notice;
45+ pid /var/run/nginx.pid;
46+
47+
48+ events {
49+ worker_connections 1024;
50+ }
51+
52+ http {
53+ include /etc/nginx/mime.types;
54+ default_type application/octet-stream;
55+
56+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
57+ '$status $body_bytes_sent "$http_referer" '
58+ '"$http_user_agent" "$http_x_forwarded_for"';
59+
60+ access_log /var/log/nginx/access.log main;
61+
62+ sendfile on;
63+ #tcp_nopush on;
64+
65+ keepalive_timeout 65;
66+
67+ #gzip on;
68+
69+ # F5 WAF for NGINX
70+ app_protect_enforcer_address 127.0.0.1:50000;
71+
72+ include /etc/nginx/conf.d/*.conf;
73+ }
74+ ```
75+
76+ {{% /tab %}}
77+
78+ {{% tab name="default.conf" %}}
79+
80+ The default path for this file is ` _/etc/nginx/conf.d/default.conf_ ` .
81+
82+ ``` nginx {hl_lines=[10]}
83+ server {
84+ listen 80;
85+ server_name domain.com;
86+
87+
88+ location / {
89+
90+ # F5 WAF for NGINX
91+ app_protect_enable on;
92+
93+ client_max_body_size 0;
94+ default_type text/html;
95+ proxy_pass http://127.0.0.1:8080/;
96+ }
97+ }
98+
99+ server {
100+ listen 8080;
101+ server_name localhost;
102+
103+
104+ location / {
105+ root /usr/share/nginx/html;
106+ index index.html index.htm;
107+ }
108+
109+ # redirect server error pages to the static page /50x.html
110+ #
111+ error_page 500 502 503 504 /50x.html;
112+ location = /50x.html {
113+ root /usr/share/nginx/html;
114+ }
115+ }
116+ ```
117+
118+ {{% /tab %}}
119+
120+ {{< /tabs >}}
0 commit comments