Hi, can u advice on this?
Hi @FourTimes
Can you elaborate a little bit your problem? I am honestly lost here.
We provide a template to create new issues in order for us to be able to provide the best support to you and the community (here).
If you don't want to use the template, at least, could you explain what are you trying to do? (for instance, which version of the Ingress Controller are you using, what is your Ingress manifest, and what you really want to accomplish?)
Thanks
Hi @Rulox
How to forward by default traffic into default backend services?
Example:
Default backend:
The default backend is a service which handles all URL paths and hosts the nginx controller doesn't understand (i.e., all the requests that are not mapped with an Ingress).
Refer Link:
https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/

Thanks for the clarification.
It seems you are using a different Ingress Controller. You are using the Kubernetes Ingress Controller created by the k8s community. Or, at least, that's their documentation.
This repository is for the NGINX Ingress Controller for NGINX and NGINX Plus created by NGINX Inc. Our documentation is here.
If you are using their Ingress Controller I suggest you to open an issue in their repository as we can't do anything to help you here. If you are using ours, let me know and I will assist you here.
Thanks
thanks for the update.
how to get the default backend services in nginx ingress controller? whereas in Kubernetes ingress controller we are getting the default service. As per documentation , little bit confused to choose which service is suitable for the default backend? Please advice on the same
I don't know how that works in the Comunity Kubernetes Ingress Controller, but I assume we do the same.
In our NGINX Ingress Controller, the default backend returns 404 and is used when NGINX doesn't find any configured location.
For example, imagine you have an Ingress Resource /api that proxies traffic to your api-svc. If you try to request to any other path (for instance /test) the default server will return a 404. This is done in order to have a failback server for all the locations that are not defined. This is hardcoded in the NGINX Config and there's no way to configure it, because it doesn't make any sense to do it (it's just a default failback server).
Maybe a solution is for you to configure an Ingress Resource with the path / so everything that doesn't match any of your defined paths will go there instead of the default server (only for the host defined in your Ingress Resource of course).
Alternatively, if you were using our Ingress Controller (which I still don't know if you are), there is 1 way to change the template that generates the final NGINX Config, check this example.
The default server is found here. This is the default server. If you'd like you would have to use the Custom Templates to change this.
Maybe if you tell me about your use case I can help you better.
Hi @Rulox
How to forward by default traffic into default backend services?
Example:
Default backend:
The default backend is a service which handles all URL paths and hosts the nginx controller doesn't understand (i.e., all the requests that are not mapped with an Ingress).
Refer Link:
https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/
Hi if you're using the nginx ingress maintained by the k8s team, the this is how you set a default backend.
Create a values.yaml file to overwrite the default configuration
defaultBackend:
name: my-default-backend
port: 3000
image:
repository: fred/mybackimage
tag: 'latest'
install the ingress with the values.yaml
helm install myingress stable/nginx-ingress -f values.yaml
@chukmunnlee how is this done for nginxinc/kubernetes-ingress?
@chukmunnlee how is this done for nginxinc/kubernetes-ingress?
I don't see this in Nginx's ingress. Your best bet is to use a catch all path or use their annotations to add something like a try_files to the route.
I don't have much experience with Nginx's ingress