访问该服务时, http://test.example.com , 陷入了 302 重定向的死循环:

location: https://test.example.com:443/

问题跟踪解决

经过排查后,发现是在自己的traefik.toml配置中,所有的http请求都会被转发到https处理,如:

defaultEntryPoints = ["http","https"]
insecureSkipVerify = true
[entryPoints]
  [entryPoints.http]
  address = ":80"
  [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
    address = ":443"
  [entryPoints.https.tls]
    [[entryPoints.https.tls.certificates]]
      certFile = "/opt/k8s/ssl/ssl.crt"
      keyFile = "/opt/k8s/ssl/ssl.key"

因为我的服务test-server是隐藏在nginx代理之后的,大概就经历了这么一个流程:

用户 --(https://test.example.com)--> nginx --(http://192.168.x.xx)--> test-server (返回302地址:https://test.example.com:443)
用户 --(https://test.example.com:443)--> nginx --(http://192.168.x.xx)--> test-server (返回302:https://test.example.com:443)
// 死循环

当前的解决方法: 取消http强制转https的逻辑, 或者只对指定的域名转https协议。

#注释traefik.toml以下两行, 更新configmap及test-server
#  [entryPoints.http.redirect]
#    entryPoint = "https"
# 或加上过滤规则,如:
[entryPoints.http.redirect]
  regex = "^http://test2.example.com/(.*)"
  replacement = "https://test2.example.com/$1"
                    问题描述通过traefik添加了服务域名代理,如:apiVersion: extensions/v1beta1kind: Ingressmetadata:  name: common-service  namespace: default  annotations:    kubernetes.io/ingress.class: traefikspec:  rules:  -...
ClusterIP的方式只能在集群内部访问。
NodePort方式的话,测试环境使用还行,当有几十上百的服务在集群中运行时,NodePort的端口管理是灾难。
LoadBalance方式受限于云平台,且通常在云平台部署ELB还需要额外的费用。
ingress可以简单理解为service的service,他通过独立的ingress对象来制定请求转发
#Add Traefik's chart repository to Helm:
helm repo add traefik https://helm.traefik.io/traefik
#You can update the chart repository by running:
helm repo update
#And install i
一文搞懂 Traefik2.1 的使用核心概念安装ACME中间件灰度发布流量复制TCP简单 TCP 服务带 TLS 证书的 TCP
Traefik 是一个开源的可以使服务发布变得轻松有趣的边缘路由器。它负责接收你系统的请求,然后使用合适的组件来对这些请求进行处理。
除了众多的功能之外,Traefik 的与众不同之处还在于它会自动发现适合你服务...
				
nginx是一款反向代理服务器,可以对外网提供服务。在使用nginx进行重定向时,可能会出现302重定向问题。这种问题通常是由于nginx配置不正确导致的。 解决方法如下: 1.检查nginx配置文件中的重定向规则是否正确,比如使用了错误的正则表达式或者匹配规则。 2.检查nginx的缓存是否正确配置,如果缓存配置不正确,可能会导致302重定向问题。 3.如果nginx反向代理的后端服务器也有重定向规则,可能会导致302重定向问题。需要检查后端服务器的重定向规则是否正确。 4.在nginx的日志中查看详细信息,以便找到导致302问题的具体原因。 总之,nginx重定向302问题的解决方法需要结合具体情况来进行调整。如果以上方法都无法解决问题,可以考虑升级nginx版本或者使用其他反向代理服务器来解决问题
const rgbLoader = new RGBELoader() // .setDataType(THREE.UnsignedByteType) .load('hdr/railway_bridges_2k.hdr', function (texture) { setDataType新版本这个注释就可以了
[Threejs]环境光与HDR贴图 wv112406: three.module.js:22758 WebGL: INVALID_VALUE: texSubImage2D: no pixels three.module.js:19554 THREE.WebGLProgram: Shader Error 1281 - VALIDATE_STATUS false Program Info Log: Fragment [Threejs]环境光与HDR贴图 wv112406: three.module.js:22758 WebGL: INVALID_VALUE: texSubImage2D: no pixels texSubImage2D @ three.module.js:22758 uploadTexture @ three.module.js:23918 setTexture2D @ three.module.js:23528 setValueT1 @ three.module.js:18139 upload @ three.module.js:18694 setProgram @ three.module.js:29273 WebGLRenderer.renderBufferDirect @ three.module.js:28156 renderObject @ three.module.js:28823 renderObjects @ three.module.js:28792 renderScene @ three.module.js:28680 WebGLRenderer.render @ three.module.js:28498 _textureToCubeUV @ three.module.js:16188 _fromTexture @ three.module.js:16006 fromEquirectangular @ three.module.js:15901 (匿名) @ room.js:62 onLoadCallback @ RGBELoader.js:458 (匿名) @ three.module.js:41786 (匿名) @ three.module.js:41311 Promise.then(异步) load @ three.module.js:41299 load @ three.module.js:41715 load @ RGBELoader.js:462 loadHDR @ room.js:61 main @ room.js:37 (匿名) @ room.js:173 three.module.js:19554 THREE.WebGLProgram: Shader Error 1281 - VALIDATE_STATUS false Program Info Log: Fragment 【MySQL】关于定期优化表(optimize table) 今天睡够了吗: 那该怎么定期优化表呢? [VSCode]command 'python.setInterpreter' not found 一枚小小白白: 为什么我找不到python.pythonPath表情包