-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
74 lines (57 loc) · 1.99 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
load_module /etc/nginx/modules/ngx_http_data_dome_auth_module.so;
load_module /etc/nginx/modules/ngx_http_data_dome_shield_module.so;
load_module /etc/nginx/modules/ngx_http_data_dome_upstream_dynamic_servers_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
########################
# DataDome Configuration
########################
resolver 8.8.8.8;
upstream datadome {
dd_server api.datadome.co:443;
keepalive 10;
}
########################
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
data_dome_auth_pass_internal_redirect on;
########################
# DataDome Configuration
########################
data_dome_auth @datadome;
location = @datadome {
data_dome_shield_key "datadome-server-side-key";
proxy_pass https://datadome/validate-request/;
proxy_method POST;
proxy_http_version 1.1;
proxy_set_header Connection "keep-alive";
proxy_set_header Content-Type "application/x-www-form-urlencoded";
proxy_set_header X-DataDome-X-Set-Cookie $data_dome_header_x_set_cookie;
proxy_set_body $data_dome_request_body;
proxy_ignore_client_abort on;
proxy_connect_timeout 250ms;
proxy_read_timeout 150ms;
}
########################
location / {
proxy_pass http://example.org;
}
}
}