Describe the bug
When I use shield API to restore shield itself cat shield_backup | shield --core shield-core curl POST https://shield-ip/v2/import -, it complains
<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>
To Reproduce
Deploy shield 8.7.2, configure some jobs including backup shield itself using metashield plugin, run a backup job for shield
Deploy shield 8.7.3
Download and decrypt the backup file for shield, save it to a plain text file: shield_backup
Run cat shield_backup | shield --core shield-core curl POST https://shield-ip/v2/import -
Expected behavior
Run successfully
Additional information
The reason it failed is that the size of the backup file is 12M, while the client_max_body_size setting is 10M.
A workaround solved the issue.
Modify client_max_body_size configure to a bigger value in the location @shield section, at the same time add client_max_body_size in the server section in the /var/vcap/jobs/core/config/nginx.conf file.
Describe the bug When I use shield API to restore shield itself
cat shield_backup | shield --core shield-core curl POST https://shield-ip/v2/import -
, it complainsTo Reproduce
cat shield_backup | shield --core shield-core curl POST https://shield-ip/v2/import -
Expected behavior Run successfully
Additional information The reason it failed is that the size of the backup file is 12M, while the
client_max_body_size
setting is 10M. A workaround solved the issue.Modify
client_max_body_size
configure to a bigger value in thelocation @shield
section, at the same time addclient_max_body_size
in the server section in the/var/vcap/jobs/core/config/nginx.conf
file.Monit stop and start nginx process on shield vm