-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.lua
27 lines (24 loc) · 820 Bytes
/
config.lua
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
-- basic config
port = 8080
working_thread_num = 4
-- cache config
cache_size_bytes = 1 << 25
cache_default_max_age = 300
cache_clean_interval = 10
-- origin config
origin_type = "upstream" -- static_file or upstream
root_dir = "." -- static_file only
upstream_host = "chenyuheng.github.io" -- upstream only
upstream_domain = "chenyuheng.github.io" -- upstream only
upstream_protocol = "https" -- upstream only
-- upstream customized config
function upstream_set(req_path, req_method, req_host)
if (req_path:find("^/chemidle") ~= nil) then
set_host("chemidle.com")
set_path(req_path.sub(req_path, 14))
end
if (req_path:find("^/upstream") ~= nil) then
set_host("upstream.host")
set_path(req_path.sub(req_path, 15))
end
end