In Kong Ingress Controller version 3.8.x, I configured an ingress backend service as an external service, and this external service is bound to an HTTPS service. Now, when a client makes an HTTP request to the ingress, it receives a 308 code, and the client directly accesses the HTTPS service, causing the Kong plugin’s header modifications not take effect. How can I configure Kong to directly forward the request to the HTTPS service?
Here is my yaml:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: s-15468-predictor-kongingress
annotations:
konghq.com/preserve-host: 'false'
konghq.com/protocols: "http"
konghq.com/rewrite: /compatible-mode/v1/chat/completions
spec:
ingressClassName: kong
rules:
- http:
paths:
- path: /s-15468/compatible-mode/v1/chat/completions
pathType: Exact
backend:
service:
name: s-15468-v1
port:
number: 80
apiVersion: v1
kind: Service
metadata:
name: s-15468-v1
spec:
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ExternalName
externalName: dashscope.aliyuncs.com
The dashscope.aliyuncs.com service url is https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions