You may expose service directly to clients using Load Balancer and add wildcard dns CNAME record *.company.com
pointing to Load Balancer. In that case you don't need Nginx Ingress which reduces latency for your clients and removes one possible bottleneck.
If you still want Nginx Ingress then you may use hostname wildcards like this:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-wildcard-host
spec:
rules:
- host: "*.foo.com"
http:
paths:
- pathType: Prefix
path: "/foo"
backend:
service:
name: service2
port:
number: 80
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…