apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: app-ingress
  namespace: nestjs-app
  annotations:
    kubernetes.io/ingress.class: nginx
    # nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: "posts.app.io"
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: app-posts
            port:
              number: 80
  - host: "votes.app.io"
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: app-votes
            port:
              number: 80