apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mailu-antispam-ingress
  namespace: mailu-mailserver
  annotations:
    kubernetes.io/tls-acme: "true"
    certmanager.k8s.io/cluster-issuer: letsencrypt-stage
    ingress.kubernetes.io/configuration-snippet: |
      rewrite ^/admin/antispam/(.*) /$1 break;
      auth_request /internal/auth/admin;
      proxy_set_header X-Real-IP "";
      proxy_set_header X-Forwarded-For "";
  labels:
    app: mailu
    role: mail
    tier: frontend
spec:
  tls:
  - hosts:
    - "mail.example.com"
    secretName: letsencrypt-certs-all # If unsure how to generate these, check out https://github.com/ployst/docker-letsencrypt
  rules:
  - host: "mail.example.com"
    http:
      paths:
      - path: "/admin/antispam"
        backend:
          serviceName: antispam
          servicePort: 11334