-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
53 lines (37 loc) · 1.28 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
user nginx;
worker_processes auto;
events { worker_connections 1024; }
http {
log_format upstream_time '$remote_addr $http_x_forwarded_for - $remote_user [$time_local] '
'$ssl_protocol "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"'
'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
access_log /var/log/nginx/access.log upstream_time;
include /etc/nginx/proxy.conf;
include /etc/nginx/mime.types;
limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;
server_tokens off;
sendfile on;
keepalive_timeout 29;
client_body_timeout 10;
client_header_timeout 10;
send_timeout 10;
upstream api_servers {
server api1:5000;
server api2:5000;
server api3:5000;
}
# Configuration for the server
server {
# Running port
listen [::]:5100;
listen 5100;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
location / {
proxy_pass http://api_servers;
limit_req zone=one burst=10 nodelay;
}
}
}