Replies: 2 comments
-
Here's what you need to do:
Here’s an updated version of your YAML file: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: isvawrp-proxy
namespace: isva-iseal
annotations:
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/affinity-mode: "persistent"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
nginx.ingress.kubernetes.io/ingress.allow-http: "false"
nginx.org/hsts-max-age: "31536000"
nginx.ingress.kubernetes.io/custom-http-errors: "502,504,500" Make sure your backend application handles the error responses (502, 504, 500) to show the desired custom error page. If necessary, you can define a separate service in Kubernetes specifically for error handling. |
Beta Was this translation helpful? Give feedback.
-
You can disable NGINX's default error pages and make sure it passes through the backend application's error pages by tweaking your NGINX configuration file. Here’s how you can do it:
proxy_intercept_errors off; But it sounds like you want the backend to handle everything, so you can probably skip this step. |
Beta Was this translation helpful? Give feedback.
-
We have an Authentication/Authorization application hosted in Container (kubernetes) platform with NGINX as Ingress. We have noticed that when the backend application is hitting errors like error codes 502, 504 500, the NGINX error page is shown and not the customized backend application error page.
Below is the YAML definition we have in our environment.
Kindly advise what is missing to ensure only the backend application error page will appear whenever there is an error on their side. It should not be the NGINX error page will appear. Please advise how to disable the NGINX error page to show. We want the backend application to appear only.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: isvawrp-proxy
namespace: isva-iseal
annotations:
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/affinity-mode: "persistent"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
nginx.ingress.kubernetes.io/ingress.allow-http: "false"
nginx.org/hsts-max-age: "31536000"
nginx.ingress.kubernetes.io/custom-http-errors: "409"
Beta Was this translation helpful? Give feedback.
All reactions