# Allow access from the internet
#
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: nginx-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  rules:
    - host: student.cloud.htl-leonding.ac.at
      http:
        paths:
          - path: /$EMAIL(/|$)(.*)$
            pathType: Prefix
            backend:
              service:
                name: nginx
                port:
                  number: 80

## backend ingress is unused, forwarded by nginx in default.conf
#---
#apiVersion: networking.k8s.io/v1
#kind: Ingress
#metadata:
#  name: appsrv-ingress
#  annotations:
#    nginx.ingress.kubernetes.io/rewrite-target: /api/$1
#spec:
#  rules:
#    - host: student.cloud.htl-leonding.ac.at
#      http:
#        paths:
#          - path: /${{ $EMAIL }}/api/(.*)$
#            pathType: Prefix
#            backend:
#              service:
#                name: appsrv
#                port:
#                  number: 8080
