413 Request Entity Too Large (nginx)

Above error shoved up in my browser when uploading a database dump to phpmyadmin. The server runs a nginx webserver and so my apache knowledge was completely useless.

But after some googling I found, i just had to add the line

    client_max_body_size 100M;

to my “http {}” Block in my /etc/nginx/nginx.conf config.

But i don’t like to edit default config files, because then they cannot automatically get updated, when i update the package, and i have to press “enter” countless times when apt upgrading. But lucky me found this line in the nginx.conf file inside the http{} block:

    include /etc/nginx/conf.d/*.conf;

If you see something like this, you know, you can just put your config values into a file located in this folder, and it wont get removed when updating the package or the main config file. Said, done, i created my file “filesizes.conf” with

    nano /etc/nginx/conf.d/filesizes.conf

and put my

    client_max_body_size 128M;

in it (don’t judge me, i like nano. If you have a problem with this, then have a good day.)
After a quick

    service nginx restart

everything worked fine and I was able to upload my database dump.