# Handling Large Requests (413 Responses)

If large requests are blocked (413 responses) make sure to adjust the limit both for NGINX/Kong and open-appsec

### For Kong and NGINX

#### NGINX

If you encounter 413 responses due to large requests, you need to adjust the request size limits in NGINX. Follow these steps:

* Refer to [NGINX documentation](http://nginx.org/en/docs/http/ngx_http_core_module.html) for detailed guidance.
* Modify the `client_max_body_size` directive in your NGINX configuration file to increase the maximum allowed request size. For example, you can set it to a larger value like 10M (10 megabytes) or as required by your application.
* After making the changes, save the configuration and reload NGINX using the appropriate command. This is typically done using `sudo systemctl reload nginx`.

#### Kong &#x20;

If you are using Kong as an API gateway and facing 413 errors due to large requests, follow these steps:

* Refer to the  [Kong Documentation](https://docs.konghq.com/hub/kong-inc/request-size-limiting/configuration/#) for specific configuration options.
* Adjust the `allowed_payload_size` or other relevant keys in your Kong configuration. Increase the maximum payload size to accommodate your application's needs.
* Save the configuration changes and restart Kong to apply them.

### For open-appsec&#x20;

#### In Web UI (Central Management)&#x20;

* Log in to the open-appsec Web UI.
* Navigate to the appropriate Asstet tab and choose the relevant asset.&#x20;
* Under Threat Prevention->Advanced adjust these settings to accommodate larger requests and save your changes.
* Enforce to apply changes&#x20;

<figure><img src="/files/gvRGsv9xLAFN7CkeDWtj" alt=""><figcaption></figcaption></figure>

#### For Declarative management&#x20;

For Docker and Linux adjust the [**practice**](https://docs.openappsec.io/getting-started/start-with-linux/local-policy-file-advanced#practices) in the local policy file

{% content-ref url="/pages/KokD6qvwxDg2XFok6k8D" %}
[Local Policy File (Advanced)](/getting-started/start-with-linux/local-policy-file-advanced.md)
{% endcontent-ref %}

For Kubernetes adjust the [**practice CRD**](https://docs.openappsec.io/getting-started/start-with-kubernetes/configuration-using-crds#practice)&#x20;

{% content-ref url="/pages/F2qjXRaybFnVkZSAp0t3" %}
[Configuration Using CRDs](/getting-started/start-with-kubernetes/configuration-using-crds.md)
{% endcontent-ref %}

By following these steps, you should be able to resolve issues related to large requests and 413 responses in NGINX, Kong, and open-appsec. Remember to back up your configuration files before making changes, and thoroughly test the adjustments to ensure they meet your application's requirements.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openappsec.io/troubleshooting/troubleshooting-guides/handling-large-requests-413-responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
