我一直在尝试在 AWS EKS 集群中运行一些服务。我按照 ingress-nginx 指南使用 AWS ACM 证书获取 https
在入口控制器使用 tls 终止
我为每个服务使用了 3 条路线作为
adminer.xxxx.com - 指向一个管理员服务
socket.xxxx.com - 指向 nodejs 编写的 wss 服务
service.xxxx.com - 指向返回连接到套接字 url 的页面的程序
没有 TLS 终止,在 http:// 中一切正常,ws://socket.xxxx.com/socket.io连接并响应良好。
当我添加 TLS 时,请求转到wss://socket.xxxx.com/socket.io并且 nginx 返回 400。我不知道为什么会发生这种情况。
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: 100m
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
# nginx.ingress.kuberenetes.io/use-regex: "true"
spec:
rules:
- host: adminer.xxxx.com
http:
paths: …Run Code Online (Sandbox Code Playgroud)