<p>When trying to upload a new theme on my fresh Wordpress install, I get the 413 Request Entity Too Large.</p>

<p>I've read a lot of other questions on StackOverflow and tried these annotations:</p>

<ul>
<li>nginx.ingress.kubernetes.io/secure-backends: "true"</li>
<li>nginx.ingress.kubernetes.io/proxy-body-size: "100m"</li>
<li>nginx.ingress.kubernetes.io/client-max-body-size: "100m"</li>
<li>nginx.org/client-max-body-size: "100m"</li>
</ul>

<p>What works:
Uploading files smaller than 1MB.</p>

<p>I guess it has to do with the Bitnami standard nginx configuration. As seen <a href="https://github.com/bitnami/bitnami-docker-wordpress-nginx/issues/4" rel="nofollow noreferrer">here</a> . But I have no clue on how to add this to my current configuration.</p>

<p>Thanks for helping me out!</p>

<pre><code>**Wordpress Debug Information:**

PHP max input variables 1000
PHP time limit  30
PHP memory limit    512M
Max input time  60
Upload max filesize 40M
PHP post max size   40M
The main WordPress directory    Writable
The wp-content directory    Writable
The uploads directory   Writable
The plugins directory   Writable
The themes directory    Writable


Deployment Yaml
{
  "kind": "Deployment",
  "apiVersion": "extensions/v1beta1",
  "metadata": {
    "name": "wordpressdf99e",
    "namespace": "default",
    "selfLink": "/apis/extensions/v1beta1/namespaces/default/deployments/wordpressdf99e",
    "uid": "f39369f1-6c1f-11ea-8b29-063deb7a2778",
    "resourceVersion": "18492542",
    "generation": 2,
    "creationTimestamp": "2020-03-22T09:31:47Z",
    "labels": {
      "app.kubernetes.io/instance": "wordpressdf99e",
      "app.kubernetes.io/managed-by": "Tiller",
      "app.kubernetes.io/name": "wordpress",
      "helm.sh/chart": "wordpress-9.0.4"
    },
    "annotations": {
      "deployment.kubernetes.io/revision": "2"
    }
  },
  "spec": {
    "replicas": 1,
    "selector": {
      "matchLabels": {
        "app.kubernetes.io/instance": "wordpressdf99e",
        "app.kubernetes.io/name": "wordpress"
      }
    },
    "template": {
      "metadata": {
        "creationTimestamp": null,
        "labels": {
          "app.kubernetes.io/instance": "wordpressdf99e",
          "app.kubernetes.io/managed-by": "Tiller",
          "app.kubernetes.io/name": "wordpress",
          "helm.sh/chart": "wordpress-9.0.4"
        },
        "annotations": {
          "kubectl.kubernetes.io/restartedAt": "2020-03-22T12:23:46+01:00"
        }
      },
      "spec": {
        "volumes": [
          {
            "name": "wordpress-data",
            "persistentVolumeClaim": {
              "claimName": "wordpressdf99e"
            }
          }
        ],
        "containers": [
          {
            "name": "wordpress",
            "image": "docker.io/bitnami/wordpress:5.3.2-debian-10-r48",
            "ports": [
              {
                "name": "http",
                "containerPort": 8080,
                "protocol": "TCP"
              },
              {
                "name": "https",
                "containerPort": 8443,
                "protocol": "TCP"
              }
            ],
            "env": [
              {
                "name": "ALLOW_EMPTY_PASSWORD",
                "value": "yes"
              },
              {
                "name": "MARIADB_HOST",
                "value": "wordpressdf99e-mariadb"
              },
              {
                "name": "MARIADB_PORT_NUMBER",
                "value": "3306"
              },
              {
                "name": "WORDPRESS_DATABASE_NAME",
                "value": "bitnami_wordpress"
              },
              {
                "name": "WORDPRESS_DATABASE_USER",
                "value": "bn_wordpress"
              },
              {
                "name": "WORDPRESS_DATABASE_PASSWORD",
                "valueFrom": {
                  "secretKeyRef": {
                    "name": "wordpressdf99e-mariadb",
                    "key": "mariadb-password"
                  }
                }
              },
              {
                "name": "WORDPRESS_USERNAME",
                "value": "user"
              },
              {
                "name": "WORDPRESS_PASSWORD",
                "valueFrom": {
                  "secretKeyRef": {
                    "name": "wordpressdf99e",
                    "key": "wordpress-password"
                  }
                }
              },
              {
                "name": "WORDPRESS_EMAIL",
                "value": "user@example.com"
              },
              {
                "name": "WORDPRESS_FIRST_NAME",
                "value": "FirstName"
              },
              {
                "name": "WORDPRESS_LAST_NAME",
                "value": "LastName"
              },
              {
                "name": "WORDPRESS_HTACCESS_OVERRIDE_NONE",
                "value": "no"
              },
              {
                "name": "WORDPRESS_BLOG_NAME",
                "value": "User's Blog!"
              },
              {
                "name": "WORDPRESS_SKIP_INSTALL",
                "value": "no"
              },
              {
                "name": "WORDPRESS_TABLE_PREFIX",
                "value": "wp_"
              },
              {
                "name": "WORDPRESS_SCHEME",
                "value": "http"
              }
            ],
            "resources": {
              "requests": {
                "cpu": "300m",
                "memory": "512Mi"
              }
            },
            "volumeMounts": [
              {
                "name": "wordpress-data",
                "mountPath": "/bitnami/wordpress",
                "subPath": "wordpress"
              }
            ],
            "livenessProbe": {
              "httpGet": {
                "path": "/wp-login.php",
                "port": "http",
                "scheme": "HTTP"
              },
              "initialDelaySeconds": 120,
              "timeoutSeconds": 5,
              "periodSeconds": 10,
              "successThreshold": 1,
              "failureThreshold": 6
            },
            "readinessProbe": {
              "httpGet": {
                "path": "/wp-login.php",
                "port": "http",
                "scheme": "HTTP"
              },
              "initialDelaySeconds": 30,
              "timeoutSeconds": 5,
              "periodSeconds": 10,
              "successThreshold": 1,
              "failureThreshold": 6
            },
            "terminationMessagePath": "/dev/termination-log",
            "terminationMessagePolicy": "File",
            "imagePullPolicy": "IfNotPresent"
          }
        ],
        "restartPolicy": "Always",
        "terminationGracePeriodSeconds": 30,
        "dnsPolicy": "ClusterFirst",
        "securityContext": {
          "runAsUser": 1001,
          "fsGroup": 1001
        },
        "schedulerName": "default-scheduler",
        "hostAliases": [
          {
            "ip": "127.0.0.1",
            "hostnames": [
              "status.localhost"
            ]
          }
        ]
      }
    },
    "strategy": {
      "type": "RollingUpdate",
      "rollingUpdate": {
        "maxUnavailable": "25%",
        "maxSurge": "25%"
      }
    },
    "revisionHistoryLimit": 10,
    "progressDeadlineSeconds": 600
  },
  "status": {
    "observedGeneration": 2,
    "replicas": 1,
    "updatedReplicas": 1,
    "readyReplicas": 1,
    "availableReplicas": 1,
    "conditions": [
      {
        "type": "Progressing",
        "status": "True",
        "lastUpdateTime": "2020-03-22T11:34:28Z",
        "lastTransitionTime": "2020-03-22T09:31:47Z",
        "reason": "NewReplicaSetAvailable",
        "message": "ReplicaSet \"wordpressdf99e-6bcf574f64\" has successfully progressed."
      },
      {
        "type": "Available",
        "status": "True",
        "lastUpdateTime": "2020-03-22T12:14:55Z",
        "lastTransitionTime": "2020-03-22T12:14:55Z",
        "reason": "MinimumReplicasAvailable",
        "message": "Deployment has minimum availability."
      }
    ]
  }
}
</code></pre>

NicholasD
<p>If you were using an external Nginx Ingress Controller you would create a configmap for your ingress controllers and set the <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#proxy-body-size" rel="nofollow noreferrer">proxy-body-size</a> to the size needed.</p>

<p><a href="https://github.com/kubernetes/ingress-nginx/blob/master/internal/ingress/controller/config/config.go#L40" rel="nofollow noreferrer">The default size for it is 1m</a></p>

<p>There is also a <a href="https://github.com/bitnami/bitnami-docker-wordpress-nginx" rel="nofollow noreferrer">bitnami wordpress nginx image</a></p>

<p>Where you can set the Server block for it directly and add <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size" rel="nofollow noreferrer">client_max_body_size</a></p>

<p><a href="https://github.com/bitnami/bitnami-docker-wordpress-nginx/blob/master/test.yaml#L9" rel="nofollow noreferrer">https://github.com/bitnami/bitnami-docker-wordpress-nginx/blob/master/test.yaml#L9</a></p>
