-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
64 lines (50 loc) · 1.51 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
user nginx;
worker_processes auto;
load_module modules/ngx_http_app_protect_module.so;
error_log /var/log/nginx/error.log debug;
events {
worker_connections 10240;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
resolver 127.0.0.11;
upstream api_backend_com {
server ergast01:80;
server ergast02:80;
}
#Demo API Key Authentication
map $http_x_api_key $api_client_name {
default "";
"P5FcvLwkyN7eethF" "client_one";
"UEt5QAEtiCYLKV5v" "client_two";
}
server {
listen 80;
# #To redirect http(80) to https(443)
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name api.apigwdemo.com;
proxy_http_version 1.1;
#Demo SSL Termination
ssl_certificate apigwdemo.com.crt;
ssl_certificate_key apigwdemo.com.key;
ssl_protocols TLSv1.3 TLSv1.2 TLSv1.1;
ssl_prefer_server_ciphers on;
app_protect_enable on;
app_protect_security_log_enable on;
app_protect_security_log "/etc/nginx/custom_log_format.json" syslog:server=elasticsearch:5144;
app_protect_policy_file "/etc/nginx/labpolicy.json";
location / {
client_max_body_size 0;
default_type text/html;
# set your backend here
proxy_pass http://api_backend_com;
proxy_set_header Host $host;
}
}
}