应用出现上传文件大小限制,报错413 Request Entity Too Large
经过检查发现是k8s nginx ingress 里面默认参数太小,需要修改,在ingress里面client_max_body_size不是配置成全局参数的,而是配置在server里面,修改方法如下
在ingress配置hosts的位置配置,在 annotations: 下面增加nginx.ingress.kubernetes.io/proxy-body-size: "100m"
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: "100m"
name: qa-zhy
spec:
rules:
- host: tmsqa.hoolinks.com
http:
paths:
- backend:
serviceName: qa-zhy
servicePort: 8080
path: /
?