nginx.conf.j2
1.82 KB
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
77
78
79
80
81
82
83
84
#worker_processes 1;
user www www;
worker_processes 4;
worker_cpu_affinity 00000001 00000010 00000100 00001000;
pid /Data/local/openresty-1.9.15.1/nginx/logs/nginx.pid;
# [ debug | info | notice | warn | error | crit ]
error_log /Data/logs/nginx/nginx_error.log error;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format fenxi '$remote_addr|$http_x_forwarded_for|[$time_local]|$http_host|$request|'
'$status|$body_bytes_sent|$request_time|$upstream_response_time|$upstream_cache_status|$http_referer|'
'$http_user_agent|$upstream_addr';
# limit req configuration limit for 20r/s for every ip
limit_req_zone $binary_remote_addr zone=limit_ufo:30m rate=20r/s;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 180;
client_max_body_size 600m;
#gzip on;
proxy_buffer_size 128k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#ufo-gateway
upstream ufogateway {
{% for i in groups['ufo-fore'] %}
server {{ i }}:8080 max_fails=5 fail_timeout=3s;
{% endfor %}
keepalive 32;
}
# ufo-gateway
upstream ufoplatform {
{% for i in groups['ufo-platform'] %}
server {{ i }}:8088 max_fails=5 fail_timeout=3s;
{% endfor %}
keepalive 100;
}
include vhosts/*.conf;
}