Problem

The following error appears during docker push.
HTTP 413 for large image uploads

Solution

  • Modify a configuration to the nginx docker container running inside the Harbor server.
    1. Run the following command to access Harbor server.
      ssh [email protected]
      
      root@airgap-server [ ~ ]#
    2. Run the following command to exec into nginx container.
      docker exec -it nginx bash
    3. Run the following commad to log in as root to the container.
      docker exec -it -u root nginx bash
    4. Add the following content in the nginx.conf file of nginx docker container in the Harbor server.
      http {
          ...
          # disable any limits to avoid HTTP 413 for large image uploads
          client_max_body_size 0;
          ...
      }
    5. Run the following command to reload nginx from inside the docker container:.
      nginx -s reload