我有一个基本的 nginx 部署和一个由 let's 通过 cert-manager 加密颁发的现有证书。我以为一切都已准备就绪,可以开始使用证书,但我无法连接 https。
连接到 LoadBalancer IP 和域可以正常工作。使用 https 连接域无法连接。Chrome 这么说ERR_SSL_PROTOCOL_ERROR,Firefox 这么说SSL_ERROR_RX_RECORD_TOO_LONG,SSL Labs 这么说Assessment failed: No secure protocols supported。都是同一个问题。
这是服务:
apiVersion: v1
kind: Service
metadata:
name: nginx
namespace: example
labels:
app: example
spec:
type: LoadBalancer
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
- name: https
protocol: TCP
port: 443
targetPort: 80
selector:
app: example
Run Code Online (Sandbox Code Playgroud)
这是入口:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx
namespace: example
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production …Run Code Online (Sandbox Code Playgroud) 我有一个 GCE Ingress 配置并在端口 443 上使用 SSL。我试图让端口 28080 指向我的独立可操作服务器。
我目前为我的 Ingress yaml 准备了这个:
# web-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gke-ingress
annotations:
kubernetes.io/ingress.class: "gce"
ingress.kubernetes.io/ssl-redirect: "true"
kubernetes.io/ingress.allow-http: "false"
spec:
rules:
- host: example.com
http:
paths:
- path: /ws
backend:
serviceName: websocket
servicePort: 28080
tls:
- secretName: gkecert
hosts:
- example.com
backend:
serviceName: web
servicePort: 443
Run Code Online (Sandbox Code Playgroud)
如果我将 websocket 服务的路径设置为 /,它会破坏根路径(错误 503)。从我读过的内容来看,入口无法处理一条路径上的 2 个端口。那么人们如何将他们的前端连接到 websocket 服务器而不用路径分隔呢?