apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: reactapp-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/app-root: /reactapp/
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/configuration-snippet: |
      rewrite ^/static/(.*)$ /reactapp/static/$1 redirect;
spec:
  rules:
  - http:
      paths:
      - path: /reactapp(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: reactapp
            port:
              number: 3000