A simple method to modify the size of Nginx uploaded files

A simple method to modify the size of Nginx uploaded files

Original link: https://vien.tech/article/138

Preface

I used Laravel to make a blog that supports markdown (a side note: it is free and open source, welcome to use VienBlog), and supports file upload. Then when uploading files, I found that files larger than 1M failed to upload because Nginx limits the size of uploaded files. I just need to modify the default upload file size limit of Nginx.

Here’s how:

We find the Nginx configuration file

nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

You can see that the print result is in /etc/nginx/nginx.conf , then edit it

vim /etc/nginx/nginx.conf

Add client_max_body_size 10m in http, as shown below

[...]
http {
 [...]
 client_max_body_size 10m;
 [...]
}
[...]

Reload configuration or restart nginx

service nginx reload

or

service nginx restart

Congratulations, Coca-Cola, you can do whatever you want.

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM.

You may also be interested in:
  • How to modify the upload file size limit in nginx
  • Solution to Nginx timeout when uploading large files
  • How to modify the file upload size limit of Nginx and PHP
  • Nginx upload file full cache solution
  • nginx:413 Request Entity Too Large solution - modify the size of PHP uploaded files
  • Solution to nginx upload file size error 500
  • Solve the PHP file upload size limit problem by modifying the configuration (nginx+php)
  • Modify the upload file size limit of Nginx and Apache
  • Solve the problem of building file upload and download service with nginx+lua

<<:  Detailed explanation of MySQL syntax, special symbols and regular expressions

>>:  How to start a Vue.js project

Recommend

CentOS uses expect to remotely execute scripts and commands in batches

Sometimes we may need to operate servers in batch...

MySql 8.0.16-win64 Installation Tutorial

1. Unzip the downloaded file as shown below . 2. ...

CSS to achieve dynamic secondary menu

Dynamically implement a simple secondary menu Whe...

Simple implementation of mini-vue rendering

Table of contents Preface Target first step: Step...

This article will show you the basics of JavaScript: deep copy and shallow copy

Table of contents Shallow copy Deep Copy Replenis...

Complete steps to build a Laravel development environment using Docker

Preface In this article, we will use Docker to bu...

Briefly talk about mysql left join inner join

Preface I have been busy developing a cold chain ...

JS implements a detailed plan for the smooth version of the progress bar

The progress bar is not smooth I believe that mos...

CSS3 analysis of the steps for making Douyin LOGO

"Tik Tok" is also very popular and is s...

Detailed explanation of JS ES6 coding standards

Table of contents 1. Block scope 1.1. let replace...

CSS3 filter code to achieve gray or black mode on web pages

front end css3,filter can not only achieve the gr...

Nginx reverse proxy configuration removes prefix

When using nginx as a reverse proxy, you can simp...

Detailed explanation of html printing related operations and implementation

The principle is to call the window.print() metho...

Detailed examples of converting rows to columns and columns to rows in MySQL

mysql row to column, column to row The sentence i...