-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
76 lines (62 loc) · 1.75 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
75
76
user nginx;
worker_processes auto;
error_log /dev/stderr notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format json_combined escape=json
'{'
'"timestamp":"$msec",'
'"httpRequest":{'
'"requestMethod":"$request_method",'
'"requestUrl":"$scheme://$host$request_uri",'
'"requestSize":$request_length,'
'"status":$status,'
'"responseSize":$bytes_sent,'
'"userAgent":"$http_user_agent",'
'"remoteIp":"$http_x_forwarded_for",'
'"serverIp":"$server_addr",'
'"referer":"$http_referer",'
'"latency":"${request_time}s",'
'"protocol":"$server_protocol"'
'}'
'}';
map $status $loggable {
~^[23] 0;
default 1;
}
access_log /dev/stdout json_combined if=$loggable;
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_http_version 1.1;
gzip_min_length 0;
gzip_proxied any;
gzip_types application/javascript application/json text/css text/plain;
gzip_vary on;
keepalive_timeout 60;
sendfile on;
tcp_nodelay on;
tcp_nopush on;
server_tokens off;
upstream backend {
server battleblocks-backend-service:8000;
}
server {
listen 8080 default_server;
server_name $hostname;
location / {
access_log off;
index index.html;
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://backend;
}
}
}