Updating workflow deployment JSON spec fails with "413 Request Entity Too Large" error in VMware Cloud Foundation (VCF).
<html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>
Symptoms:
The curl command returns a standard HTML error page: 413 Request Entity Too Large.
The workflow.json file size is confirmed to be greater than 1 MB.
When attempting to update the workflow JSON specification via curl, the operation fails with an HTTP 413 error. The following error is recorded in the Nginx error log located at /var/log/vmware/vcf/nginx/error.log:
YYYY/MM/DD HH:MM:SS [error] <PID>#0: *145 client intended to send too large body: 1376880 bytes, client: ::1, server: localhost, request: "PUT /domainmanager/internal/vault/<Task_ID> HTTP/1.1", host: "localhost"
VMware Cloud Foundation (VCF) 5.2.x
The default Nginx configuration for the /domainmanager/ location block does not specify a client_max_body_size. In Nginx, the default limit for client request bodies is 1 MB. If the workflow.json file exceeds this size, Nginx rejects the PUT request before it can be processed by the backend service.
To resolve this, you must increase the client_max_body_size within the Nginx configuration.
Note: Ensure a virtual machine snapshot of the SDDC Manager is taken before proceeding with these manual configuration changes.
Backup the configuration file: cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
Enable write permissions for the file: chmod +w /etc/nginx/nginx.conf
Modify the Nginx configuration: Locate the location /domainmanager/ block in /etc/nginx/nginx.conf and add the client_max_body_size 10m; directive:
location /domainmanager/ { # internal mapping (about, et al) client_max_body_size 10m; proxy_pass http://127.0.0.1:7200;}Restore read-only permissions: chmod -w /etc/nginx/nginx.conf
Restart the Nginx service to apply changes: systemctl restart nginx
Retry the workflow update command: curl -k -s http://localhost/domainmanager/internal/vault/<task_id> -X PUT -H "Content-type: text/plain" -d @/home/vcf/workflow.json
If the workflow.json file is exceptionally large (e.g., in very large-scale environments), the 10m (10 Megabytes) value can be adjusted higher as needed. Always verify the file size using ls -lh /home/vcf/workflow.json before setting the limit.