-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
52 lines (37 loc) · 1.23 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
user www-data;
worker_processes auto;
events {
worker_connections 1024;
}
http {
upstream austraits-api {
server localhost:8000;
}
log_format postdata escape=json '$remote_addr - $remote_user [$time_local] '
'"$request" "$request_body" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
limit_req_zone $binary_remote_addr zone=limit:10m rate=10r/s;
server {
listen 80;
location / {
proxy_pass http://austraits-api;
limit_req zone=limit burst=20 nodelay;
limit_req_status 429;
access_log /var/log/nginx/access.log postdata;
client_body_in_single_buffer on;
}
location /health-check {
proxy_pass http://austraits-api/health-check;
limit_req zone=limit burst=20 nodelay;
limit_req_status 429;
access_log off;
}
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2)$ {
proxy_pass http://austraits-api;
limit_req zone=limit burst=20 nodelay;
limit_req_status 429;
add_header Cache-Control "max-age=1296000";
access_log off;
}
}
}