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

How to use limit_req_zone in Nginx to limit the access to the same IP

Nginx can use the limit_req_zone directive of the...

Sharing tips on using Frameset to center the widescreen

Copy code The code is as follows: <frameset co...

Full-screen drag upload component based on Vue3

This article mainly introduces the full-screen dr...

Steps to deploy ingress-nginx on k8s

Table of contents Preface 1. Deployment and Confi...

Several common ways to deploy Tomcat projects [tested]

1 / Copy the web project files directly to the we...

Implementation of IP address configuration in Centos7.5

1. Before configuring the IP address, first use i...

Summary of using the reduce() method in JS

Table of contents 1. Grammar 2. Examples 3. Other...

Detailed explanation of how to use Node.js to implement hot reload page

Preface Not long ago, I combined browser-sync+gul...

How to automatically import Vue components on demand

Table of contents Global Registration Partial Reg...

Docker core and specific use of installation

1. What is Docker? (1) Docker is an open source t...

Docker compose custom network to achieve fixed container IP address

Due to the default bridge network, the IP address...

Nginx signal control

Introduction to Nginx Nginx is a high-performance...

Docker connection mongodb implementation process and code examples

After the container is started Log in to admin fi...