Skip to content

Commit b17db73

Browse files
committed
Implement error page
1 parent 3224600 commit b17db73

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

openid-connect-provider-debugger/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ RUN apk update \
1414
&& "luarocks-${LUA_VERSION}" config variables.LUA_INCDIR "${LUA_INCDIR}" \
1515
&& "luarocks-${LUA_VERSION}" install lua-resty-openidc
1616

17-
COPY nginx.conf.patch /usr/local/openresty/nginx/conf/nginx.conf.patch
17+
COPY nginx.conf.patch /usr/local/openresty/nginx/conf/
1818

1919
RUN patch /usr/local/openresty/nginx/conf/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf.patch \
2020
&& rm -f /usr/local/openresty/nginx/conf/nginx.conf.patch \
2121
&& chmod o+rwx /var/run/openresty
2222

23-
COPY default.conf /etc/nginx/conf.d/default.conf
23+
COPY default.conf /etc/nginx/conf.d/
2424

25-
COPY index.html /usr/local/openresty/nginx/html/index.html
25+
COPY index.html error.html /usr/local/openresty/nginx/html/
2626

2727
EXPOSE 80 443

openid-connect-provider-debugger/default.conf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ access_log /dev/stdout;
22

33
lua_capture_error_log 32m;
44

5+
error_page 500 /error.html;
6+
57
init_by_lua_block {
68
local errlog = require('ngx.errlog')
79
local status, err = errlog.set_filter_level(ngx.DEBUG)
@@ -30,12 +32,9 @@ server {
3032
set $session_check_ua off;
3133
set $session_check_scheme off;
3234
set $session_check_addr off;
35+
set $session_cookie_secure on;
3336
set $session_cookie_samesite None;
3437

35-
location /favicon.ico {
36-
return 204;
37-
}
38-
3938
location ~ ^/(debug|login) {
4039
access_by_lua_block {
4140
local cjson = require('cjson')
@@ -158,5 +157,9 @@ server {
158157
ngx.exit(ngx.status)
159158
}
160159
}
160+
161+
location /favicon.ico {
162+
return 204;
163+
}
161164

162165
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Unexpected error</title>
6+
</head>
7+
<body>
8+
<center><b>An unexpected error occurred, please see console log for details.</b></center>
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)