简体   繁体   English

使用kubernetes入口和重定向的traefik pathprefixstrip不起作用

[英]traefik pathprefixstrip with kubernetes ingress and redirect doesn't work

I use traefik with Kubernetes Ingress with following configuration: 我将traefik与Kubernetes Ingress结合使用,配置如下:

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 当我尝试使用hostname/loxberry打开服务时,它将重定向到hostname/admin/system/index.cgi hostname/loxberry

curl to hostname/loxberry gives me following result: 卷曲到hostname/loxberry给了我以下结果:

<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? 有人可以帮我吗?

I assume that you are using Meta refresh method here for automatic redirection: 我假设您在此处使用元刷新方法进行自动重定向:

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

http-equiv="refresh" method for refreshing current web page with URL parameter 使用URL参数刷新当前网页的http-equiv="refresh"方法

content parameter specifies the time interval in seconds, here you have set 0 immediate action; content参数指定时间间隔(以秒为单位),此处您设置了0立即行动;

Therefore, you get redirection of hostname/loxberry to the target hostname/admin/system/index.cgi . 因此,您可以将hostname/loxberry重定向到目标hostname/admin/system/index.cgi hostname/loxberry

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM