-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
48 lines (37 loc) · 1.53 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
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
resolver 8.8.8.8;
upstream dddd {
server search.lefeng.com;
keepalive 100;
}
lua_shared_dict shared_data 1m;
lua_package_path "/opt/openresty/openresty-example/lualib/?.lua;;";#lua 模块
lua_package_cpath "/opt/openresty/openresty-example/lualib/?.so;;";#c模块
lua_max_pending_timers 1024; #最大等待任务数
lua_max_running_timers 256; #最大同时运行任务数
lua_socket_pool_size 30; #默认连接池大小,默认30
lua_socket_keepalive_timeout 60s; #默认超时时间,默认60s
map $host $item_dynamic {
default "0";
item2014.jd.com "1";
}
#nginx Master进程加载配置时执行;通常用于初始化全局配置/预加载Lua模块
#init_by_lua_file /opt/openresty/openresty-example/lua/test_5_init.lua;
#每个Nginx Worker进程启动时调用的计时器,如果Master进程不允许则只会在init_by_lua之后调用;通常用于定时拉取配置/数据,或者后端服务的健康检查
#init_worker_by_lua_file /opt/openresty/openresty-example/lua/test_6_init_worker.lua;
include /opt/openresty/openresty-example/lua.conf;
}