-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add 50x html for error page #4164
Changes from 1 commit
ab4714b
106cd05
06ea9d3
568717a
8fbd9ae
f83d3f2
cbf26ff
75ac3a2
6f983eb
e4af86c
68e9ac6
162979a
b56e3fa
3e9cd34
7af6bc6
110a2b5
4cbb490
e838d57
a3ee96d
76931dd
bd2c21b
930e83a
e61724e
48a434c
adf8710
86b24c2
93a69f4
c53f252
03255e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ local etcd = require("apisix.cli.etcd") | |
local util = require("apisix.cli.util") | ||
local file = require("apisix.cli.file") | ||
local ngx_tpl = require("apisix.cli.ngx_tpl") | ||
local html_page = require("apisix.cli.html_page") | ||
local profile = require("apisix.core.profile") | ||
local template = require("resty.template") | ||
local argparse = require("argparse") | ||
|
@@ -586,6 +587,11 @@ Please modify "admin_key" in conf/config.yaml . | |
if not ok then | ||
util.die("failed to update nginx.conf: ", err, "\n") | ||
end | ||
|
||
local ok, err = util.write_file(env.apisix_home .. "/html/50x.html", html_page) | ||
if not ok then | ||
util.die("failed to write 50x.html: ", err, "\n") | ||
end | ||
end | ||
|
||
|
||
|
@@ -605,6 +611,9 @@ local function start(env, ...) | |
local cmd_logs = "mkdir -p " .. env.apisix_home .. "/logs" | ||
util.execute_cmd(cmd_logs) | ||
|
||
local cmd_html = "mkdir -p " .. env.apisix_home .. "/html" | ||
util.execute_cmd(cmd_html) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why adding an empty line here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Please review it again. |
||
-- check running | ||
local pid_path = env.apisix_home .. "/logs/nginx.pid" | ||
local pid = util.read_file(pid_path) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -533,7 +533,7 @@ end | |
|
||
|
||
function _M.http_header_filter_phase() | ||
if not ngx.ctx then | ||
if not ngx.ctx or not ngx.ctx.api_ctx then | ||
ngx.ctx = ctxdump.apply_ngx_ctx(ngx_var.ctx_ref) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stash There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Please review it again. |
||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add it to gitignore:
apisix/.gitignore
Line 48 in 504cd1b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Please review it again.