Comment on page
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
If you encounter 413 responses due to large requests, you need to adjust the request size limits in NGINX. Follow these steps:
- Modify the
client_max_body_sizedirective 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.
If you are using Kong as an API gateway and facing 413 errors due to large requests, follow these steps:
- Adjust the
allowed_payload_sizeor 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.
size limtions in Web UI
- Log in to the open-appsec Web UI.
- Navigate to the appropriate Asstet tab and choose the relevant asset.
- Under Threat Prevention->Advanced adjust these settings to accommodate larger requests and save your changes.
- Enforce to apply changes
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.