Use nginx upstreams and reload only if configuration changes
This commit is contained in:
parent
d0a15b1267
commit
cad814cbb3
50 changed files with 370 additions and 10432 deletions
27
controllers/nginx-third-party/lua/error_page.lua
vendored
27
controllers/nginx-third-party/lua/error_page.lua
vendored
|
|
@ -21,30 +21,3 @@ function openURL(status, page)
|
|||
|
||||
ngx.say(res.body)
|
||||
end
|
||||
|
||||
|
||||
function openCustomErrorURL(status, page)
|
||||
local httpc = http.new()
|
||||
|
||||
data = {}
|
||||
data["code"] = status
|
||||
data["format"] = ngx.var.httpAccept
|
||||
local params = "/error?"..ngx.encode_args(data)
|
||||
local res, err = httpc:request_uri(page, {
|
||||
path = params,
|
||||
method = "GET"
|
||||
})
|
||||
|
||||
if not res then
|
||||
ngx.log(ngx.ERR, err)
|
||||
ngx.exit(500)
|
||||
end
|
||||
|
||||
ngx.status = tonumber(status)
|
||||
ngx.header["Content-Type"] = ngx.var.httpReturnType or "text/plain"
|
||||
if ngx.var.http_cookie then
|
||||
ngx.header["Cookie"] = ngx.var.http_cookie
|
||||
end
|
||||
|
||||
ngx.say(res.body)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue