apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: web
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: letsencrypt
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/configuration-snippet: |
      rewrite ^(/dashboard)$ $1/ redirect;

spec:
  rules:
  - host: alex.agx.ru
    http:
      paths:
      - path: /web(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: web-svc
            port:
              number: 8000
      - path: /
        pathType: Prefix
        backend:
          service:
            name: web-svc
            port:
              number: 8000
  tls:
  - hosts:
    - alex.agx.ru
    secretName: agx-cert
