How to fix Plesk error Cannot set up client_max_body_size for Nginx?

How to fix Plesk error Cannot set up client_max_body_size for Nginx?

Do you often get the error Cannot set up client_max_body_size for Nginx? To prevent client_max_body_size, this #PPPM-1914 helps to get rid of this problem. For instance, 1m is the value for server-wide at the same time domain itself fixes the Plesk value ‘client_max_body_size 128m;’.

Here, 128m is the value for server-wide even it has 1m. Let us start the steps one by one:

Step 1:
Use SSH for connecting Plesk server. Now, set the Nginx global value with the command:

# echo 'client_max_body_size 128m;' > /etc/nginx/conf.d/aa_client_max_body.conf

Step 2: Use below command to modify the lines in the file /usr/local/psa/admin/conf/panel.ini:

# echo -e "[webserver]\n nginxClientMaxBodySize =\n" >> /usr/local/psa/admin/conf/panel.ini

Step 3: If you find that panel.ini is not present then create a sample file by giving the permissions to access it.

# cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini

# chmod 644 /usr/local/psa/admin/conf/panel.ini

Step 4: Execute the command to configure the regeneration of Apache:

# plesksbinhttpdmng --reconfigure-all

Step 5: Use the below command to restart Nginx:

# service nginx restart

By now, your problem will be fixed. You will not get a Plesk error Cannot set up client_max_body_size for Nginx with all the five steps.
Author
kumkumsharma
Views
2,762
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top