+++ title = "Fallback service" weight = 15 +++ In this learning lab, you will learn how to setup a fallback service using Ingress resource. The fallback service will receive all requests that don't match against any of the defined Ingress rules. This can be useful for scenarios where you would like to return a 404 page to the end user if the user clicks on a dead link or inputs an incorrect URL. #### Set up Ingress rule Add ingress resource for echo service Add an Ingress resource which proxies requests to and /cafe to the echo service ```bash echo ' apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: demo-fallback annotations: konghq.com/strip-path: "true" kubernetes.io/ingress.class: kong spec: rules: - http: paths: - path: /cafe pathType: Prefix backend: service: name: echo port: number: 80 ' | kubectl apply -f - ``` **Response** ``` ingress.extensions/demo created ``` **Verify** Test the Ingress rule: ```bash curl -i $DATA_PLANE_LB/cafe/status/200 ``` **Response** ``` HTTP/1.1 200 OK Content-Type: text/plain; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Date: Tue, 19 Oct 2021 20:02:36 GMT Server: echoserver X-Kong-Upstream-Latency: 0 X-Kong-Proxy-Latency: 0 Via: kong/2.6.0.0-enterprise-edition Hostname: echo-5fc5b5bc84-r47nz Pod Information: node name: ip-192-168-72-99.us-east-2.compute.internal pod name: echo-5fc5b5bc84-r47nz pod namespace: default pod IP: 192.168.84.208 Server values: server_version=nginx: 1.12.2 - lua: 10010 Request Information: client_address=192.168.71.216 method=GET real path=/status/200 query= request_version=1.1 request_scheme=http request_uri=http://ae4164bb79dab4238859875597b65fd3-389728867.us-east-2.elb.amazonaws.com:8080/status/200 Request Headers: accept=*/* connection=keep-alive host=ae4164bb79dab4238859875597b65fd3-389728867.us-east-2.elb.amazonaws.com user-agent=curl/7.76.1 x-forwarded-for=192.168.21.194 x-forwarded-host=ae4164bb79dab4238859875597b65fd3-389728867.us-east-2.elb.amazonaws.com x-forwarded-path=/cafe/status/200 x-forwarded-port=80 x-forwarded-prefix=/cafe x-forwarded-proto=http x-real-ip=192.168.21.194 Request Body: -no body in request- ``` #### Create a fallback sample service. Add a KongPlugin resource for the fallback service ```bash cat <