mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
314 lines
6.2 KiB
Text
314 lines
6.2 KiB
Text
|
|
|
|
|
|
|
|
error_page 400 @400;
|
|
|
|
location @400 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 400 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 401 @401;
|
|
|
|
location @401 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 401 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 403 @403;
|
|
|
|
location @403 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 403 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 404 @404;
|
|
|
|
location @404 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 404 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 405 =200 @405;
|
|
|
|
location @405 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 405 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 413 @413;
|
|
|
|
location @413 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 413 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 429 @429;
|
|
|
|
location @429 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 429 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 500 @500;
|
|
|
|
location @500 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 500 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 501 @501;
|
|
|
|
location @501 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 501 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 502 @502;
|
|
|
|
location @502 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 502 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 503 @503;
|
|
|
|
location @503 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 503 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 504 @504;
|
|
|
|
location @504 {
|
|
auth_basic off;
|
|
internal;
|
|
modsecurity off;
|
|
default_type 'text/html';
|
|
content_by_lua_block {
|
|
local logger = require "logger"
|
|
local errors = require "errors.errors"
|
|
local html, err
|
|
if ngx.status == 200 then
|
|
html, err = errors.error_html(tostring(405))
|
|
else
|
|
html, err = errors.error_html(tostring(ngx.status))
|
|
end
|
|
if not html then
|
|
logger.log(ngx.ERR, "ERRORS", "Error while computing HTML error template for 504 : " .. err)
|
|
else
|
|
ngx.say(html)
|
|
end
|
|
}
|
|
}
|
|
|