Docs/CloudNative/Kubernetes/Base/nginx-ingress上传文件大小限制.md

28 lines
773 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

nginx-ingress默认文件传输大小为1M类似nginx中client_max_body_size因业务需要配置为10M。配置方法为在需要大文件传输的ingress中配置注解annotationsnginx.ingress.kubernetes.io/proxy-body-size: "10m"
详细配置举例如下:
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: test-server-ing
namespace: test
labels:
app: test-server-ing
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 10m
spec:
ingressClassName: nginx
rules:
- host: test.test.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: test-server-svc
port:
number: 80
```