Skip to content

Commit

Permalink
BAH-2566 | add custom error page for internal error (#9)
Browse files Browse the repository at this point in the history
* BAH-2566 | added customized default backend for internal error

* BAH-2566 | updated custom error configs based on helm

Co-authored-by: MOHANKUMAR T <[email protected]>
  • Loading branch information
kavitha-sundararajan and mohan-13 authored Jan 12, 2023
1 parent 5fc9d78 commit 6bc8cac
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
run: aws eks update-kubeconfig --name $CLUSTER_NAME
- name: Install Nginx Ingress
run: |
kubectl apply -f custom-error-pages/custom-error.yaml -n ingress-nginx
helm upgrade ingress-nginx ingress-nginx \
--repo https://kubernetes.github.io/ingress-nginx \
--namespace=ingress-nginx --create-namespace \
Expand Down
25 changes: 25 additions & 0 deletions custom-error-pages/custom-error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: custom-error-pages
data:
500: |
<!DOCTYPE html>
<html>
<head>
<title>500 Internal Server Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<img src="/bahmni-logo.png" alt="Bahmni" width="200" />
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body>
</html>
19 changes: 19 additions & 0 deletions values/ingress_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ controller:
listen 2443;
return 308 https://$host$request_uri;
}
custom-http-errors: "500"
containerPort:
http: 80
https: 443
Expand All @@ -18,3 +19,21 @@ controller:
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "https"
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
service.beta.kubernetes.io/aws-load-balancer-type: nlb
defaultBackend:
enabled: true
image:
registry: registry.k8s.io
image: ingress-nginx/nginx-errors
tag: "v20220916-gd32f8c343@sha256:09c421ac743bace19ab77979b82186941c5125c95e62cdb40bdf41293b5c275c"
extraVolumes:
- name: custom-error-pages
configMap:
name: custom-error-pages
items:
- key: "500"
path: "500.html"
- key: "500"
path: "500.json"
extraVolumeMounts:
- name: custom-error-pages
mountPath: /www

0 comments on commit 6bc8cac

Please sign in to comment.