-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
53 lines (40 loc) · 1.31 KB
/
nginx.conf
File metadata and controls
53 lines (40 loc) · 1.31 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
worker_processes 1;
events {
worker_connections 1024;
}
error_log /data/logs/nginx/error.log;
http {
include mime.types;
default_type text/plain;
sendfile on;
keepalive_timeout 65;
lua_package_path "/data/server/nginx/nginx/conf/?.lua;;";
# lua_package_cpath "/data/server/nginx/zynsc_lua/package/?.so;;";
lua_shared_dict globle_cache 10m;
init_worker_by_lua_block {
local worker = require("init_work")
worker.init_work()
}
upstream dynamic_upstream {
server 0.0.0.0;
balancer_by_lua_file /data/server/nginx/lualib/balancer.lua;
}
server {
listen 80;
server_name localhost;
location / {
lua_code_cache on;
# access_by_lua '
# ngx.say(ngx.var.server_addr, ":", ngx.var.server_port, " haha, it\'s me")
# ';
# 通过content lua获取请求的url,参数,来源地址等,先做access处理,然后根据url和参数做rewrite处理,再做upstream处理
set $upaddr "";
content_by_lua_file /data/server/nginx/lualib/content.lua;
proxy_pass http://dynamic_upstream;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}