Skip to content

Commit 6bc8cac

Browse files
BAH-2566 | add custom error page for internal error (#9)
* BAH-2566 | added customized default backend for internal error * BAH-2566 | updated custom error configs based on helm Co-authored-by: MOHANKUMAR T <mohan13081999@gmail.com>
1 parent 5fc9d78 commit 6bc8cac

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.github/workflows/deploy.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
run: aws eks update-kubeconfig --name $CLUSTER_NAME
5555
- name: Install Nginx Ingress
5656
run: |
57+
kubectl apply -f custom-error-pages/custom-error.yaml -n ingress-nginx
5758
helm upgrade ingress-nginx ingress-nginx \
5859
--repo https://kubernetes.github.io/ingress-nginx \
5960
--namespace=ingress-nginx --create-namespace \

custom-error-pages/custom-error.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: custom-error-pages
5+
data:
6+
500: |
7+
<!DOCTYPE html>
8+
<html>
9+
<head>
10+
<title>500 Internal Server Error</title>
11+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
12+
<link rel="stylesheet" href="style.css" />
13+
</head>
14+
<body>
15+
<img src="/bahmni-logo.png" alt="Bahmni" width="200" />
16+
<h1>Internal Server Error</h1>
17+
<p>The server encountered an internal error or
18+
misconfiguration and was unable to complete
19+
your request.</p>
20+
<p>Please contact the server administrator to inform them of the time this error occurred,
21+
and the actions you performed just before this error.</p>
22+
<p>More information about this error may be available
23+
in the server error log.</p>
24+
</body>
25+
</html>

values/ingress_config.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ controller:
55
listen 2443;
66
return 308 https://$host$request_uri;
77
}
8+
custom-http-errors: "500"
89
containerPort:
910
http: 80
1011
https: 443
@@ -18,3 +19,21 @@ controller:
1819
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "https"
1920
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
2021
service.beta.kubernetes.io/aws-load-balancer-type: nlb
22+
defaultBackend:
23+
enabled: true
24+
image:
25+
registry: registry.k8s.io
26+
image: ingress-nginx/nginx-errors
27+
tag: "v20220916-gd32f8c343@sha256:09c421ac743bace19ab77979b82186941c5125c95e62cdb40bdf41293b5c275c"
28+
extraVolumes:
29+
- name: custom-error-pages
30+
configMap:
31+
name: custom-error-pages
32+
items:
33+
- key: "500"
34+
path: "500.html"
35+
- key: "500"
36+
path: "500.json"
37+
extraVolumeMounts:
38+
- name: custom-error-pages
39+
mountPath: /www

0 commit comments

Comments
 (0)