traefik pathprefixstrip with kubernetes ingress and redirect doesn't work

12/9/2018

I use traefik with Kubernetes Ingress with following configuration:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.frontend.rule.type: PathPrefixStrip
  name: loxberry
  namespace: default
spec:
  rules:
  - host: hostname
    http:
      paths:
      - path: /loxberry
        backend:
          serviceName: loxberry-service
          servicePort: 80

when I try to open my service with hostname/loxberry it gets redirected to hostname/admin/system/index.cgi

curl to hostname/loxberry gives me following result:

<title>LoxBerry</title>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="refresh" content="0; URL=/admin/system/index.cgi" />

Can anybody please help me?

-- zetti12345
kubernetes
kubernetes-ingress
traefik

1 Answer

12/17/2018

I assume that you are using Meta refresh method here for automatic redirection:

meta http-equiv="refresh" content="0; URL=/admin/system/index.cgi"

http-equiv="refresh" method for refreshing current web page with URL parameter

content parameter specifies the time interval in seconds, here you have set 0 immediate action;

Therefore, you get redirection of hostname/loxberry to the target hostname/admin/system/index.cgi.

-- mk_sta
Source: StackOverflow