Nginx Upload File Cache solution _ javascript skills

Source: Internet
Author: User
By default, Nginx caches uploaded files locally and then forwards them to the application server. How can I disable this cache so that Nginx can only forward but not cache files? This article describes in detail all the cache solutions for files uploaded by Nginx. If you have any need, refer to the following text instructions to explain all the cache solutions for files uploaded by Nginx.

Because the Application Server (Jetty) implements a progress bar during upload. Cached. The progress cannot be read. In addition, caching files in Nginx also reduces the transmission efficiency.

Nginx uses 1.5.6.

The backend uses nodejs + formidable to upload files. The corresponding content of this problem does not have much to do with the backend.

Problem:

On the front-end page, the file is uploaded. nginx does not forward all received file data blocks to the backend, but caches all the data blocks. After receiving all the data, it forwards the data blocks to the backend, obviously, the upload time is extended.

Involved modules:Ngx_http_core_module

Method:

Upgrade nginx to 1.7.11 or later.

Add command:Proxy_request_buffering off

Instructions are as follows:

Refer:

Http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_request_buffering

Restart nginx.

This solution solves the problem of caching all files uploaded by Nginx. There are more than one solution in this article. You are welcome to share your solutions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.