Home > Web Front-end > JS Tutorial > body text

Nginx upload file all cache solution_javascript skills

WBOY
Release: 2016-05-16 15:44:42
Original
1478 people have browsed it

The following is a detailed explanation of all caching solutions for Nginx uploaded files through text descriptions.

Because the application server (Jetty) implements a progress bar when uploading. Cached. There is no way to read the progress. In addition, caching files at Nginx also reduces transmission efficiency.

nginx uses 1.5.6.

The backend uses nodejs formidable to accept uploaded files. The response to this problem has nothing to do with what kind of backend is used. Here is just an explanation.

Question:

Upload the file on the front-end page. nginx does not forward each received file data block to the back-end, but caches them all. After all collection is completed, it forwards them to the back-end piece by piece. It is obvious that The upload time has been extended a lot.

Module involved in the problem: ngx_http_core_module

Corresponding method:

Upgrade the nginx version to 1.7.11 or above.

Add directive: proxy_request_buffering off

The instructions are as follows:

Reference:

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

Restart nginx and the problem will be solved.

This solution solves the problem of caching all the files uploaded by Nginx. The solution is not just the one in this article, but there are others. Everyone is welcome to share your own solutions.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template