How to Increase Max Upload size in PHPMyAdmin in Nginx

Through this tutorial, you will learn how to increase/set max file upload size in PHP Nginx.

How to Increase Max Upload size in PHPMyAdmin in Nginx?

Here are steps:

  • Step 1 – Open NGINX configuration file
  • Step 2 – Increase File Upload Size in NGINX
  • Step 3 – Restart NGINX

Step 1 – Open NGINX configuration file

Run the following command on the terminal to open the NGINX configuration file in a text editor.

$ sudo /etc/nginx/nginx.conf

Step 2 – Increase File Upload Size in NGINX

Now, increase the file upload size to 100MB across your entire site. To edit the line client_max_body_size 100M: as follows:

http{
   ...
   client_max_body_size 100M;
   ...
}

To increase file size upload limit only for HTTPS requests but not HTTP requests. In that situation, the line client_max_body_size 100M to server block that listens to HTTPS port 443 but not the server block that listens to port 80.

server{
  listen 80;
  ...
}
server{
  listen 443;
  ...
}

You can also use the above technique, if you want to set file upload size only for a specific website/domain/subdomain/app.

In that, you can add the line client_max_body_size 100M. Let’s say you want to increase file upload size for /uploads folder

location /uploads {
    ...
    client_max_body_size 100M;
}

Step 3 – Restart NGINX

Execute the following command on the terminal to restart Nginx:

$ sudo nginx -t

If there are no errors, execute the following command on terminal to restart NGINX server.

$ sudo service nginx reload #debian/ubuntu
$ systemctl restart nginx #redhat/centos

Conclusion

That’s it! Through this tutorial, you have learned how to set/increase the file upload size limit in NGINX.

Recommended Tutorials

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *