-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
63 lines (50 loc) · 1.38 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
#user nobody;
worker_processes auto;
#error_log logs/error.log notice;
error_log logs/error.log;
#pid logs/nginx.pid;
events {
worker_connections 10240;
}
env kube_config_host;
env kube_config_port;
env kube_config_token;
http {
include mime.types;
server_tokens off;
#default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
lua_package_path "/usr/local/openresty/nginx/lua/?.lua;;";
lua_shared_dict upstream_sh_data 1000M;
init_by_lua_block {
require("resty.core")
collectgarbage("collect")
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent()
local ok, res = pcall(require, "balancer")
if not ok then
error("require failed: " .. tostring(res))
else
balancer = res
end
}
init_worker_by_lua_file lua/init_work.lua;
upstream upstream_balancer {
server 0.0.0.1; # placeholder
keepalive 32;
balancer_by_lua_block {
balancer.balance()
}
}
proxy_next_upstream_tries 3;
keepalive_requests 5000;
include conf.d/*.conf;
}