ingress上传大小限制设置

Nginx Ingress Controller

对于 Nginx Ingress Controller,您可以通过在 Ingress 资源上设置 nginx.ingress.kubernetes.io/proxy-body-size 注解来限制上传大小。例如:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: "50m" # 设置上传大小限制为 50 MB
  name: example-ingress
  namespace: example
spec:
  # Ingress 规则...

Traefik Ingress Controller

对于 Traefik Ingress Controller,您可以使用标签或注解来设置上传和下载大小限制。以下是设置上传和下载大小的示例:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    traefik.ingress.kubernetes.io/max-body-size: "50m" # 设置上传大小限制为 50 MB
  name: example-ingress
  namespace: example
spec:
  # Ingress 规则...

你可能感兴趣的:(ingress,k8s)