每当从 auth-url 收到的 401,402、403..etc http 状态响应(除了 400 入口)正确地向客户端发送身份验证响应,但如果 400 错误请求入口发送为 500 内部服务器错误,并且它也不向客户端返回身份验证响应*
请找到入口文件、日志和响应
入口文件
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-stl-dsm
namespace: pfttx
annotations:
nginx.ingress.kubernetes.io/auth-url: http://pniauthapp.pfttx.svc.cluster.local:8080/sterlite/pniaa/authenticateUrl$request_uri
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS, DELETE"
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:
- host: demo-routing-aks-ingress.eastus.cloudapp.azure
http:
paths:
- path: /(sterlite/[a-zA-Z0-9]{3})(/dsm/.*)
backend:
serviceName: dsm-svc
servicePort: 32000
入口日志
10.60.66.147 - - [03/Nov/2021:10:28:29 +0000] "GET /sterlite/co1/dsm/v1/fetch_olt_list HTTP/1.1" 400 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36" 0 0.020 [pfttx-dsm-svc-32000] [] 10.97.137.97:8080 0 0.020 400 20572df79a2e6788bc1df5a4f1e383db
2021/11/03 10:28:29 [error] 1435#1435: *181347 auth request unexpected status: 400 while sending to client, client: 10.60.66.147, server: demo-routing-aks-ingress.eastus.cloudapp.azure, request: "GET /sterlite/co1/dsm/v1/fetch_olt_list HTTP/1.1", host: "demo-routing-aks-ingress.eastus.cloudapp.azure:32355"
10.60.66.147 - - [03/Nov/2021:10:28:29 +0000] "GET /sterlite/co1/dsm/v1/fetch_olt_list HTTP/1.1" 500 579 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36" 591 0.020 [pfttx-dsm-svc-32000] [] - - - - 20572df79a2e6788bc1df5a4f1e383db
每当从 auth-url 收到的 401,402、403..etc http 状态响应(除了 400 入口)正确地向客户端发送身份验证响应,但如果 400 错误请求入口发送为 500 内部服务器错误并且它不向客户端返回身份验证响应
回复:
<html>
<head>
<title>500 Internal Server Error</title>
</head>
<body>
<center>
<h1>500 Internal Server Error</h1>
</center>
<hr>
<center>nginx/1.19.0</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->