Ethan
Ethan

Reputation: 4995

Nginx: Speeding up Image Upload?

My python application sits behind an Nginx instance. When I upload an image, which is one of the purpose of my app, I notice that nginx first saves the image in filesystem (used 'watch ls -l /tmp') and then hands it over to the app. Can I configure Nginx to work in-memory with image POST? My intent is to avoid touching the slow filesystem (the server runs on an embedded device).

Upvotes: 1

Views: 793

Answers (1)

SingleNegationElimination
SingleNegationElimination

Reputation: 156238

Yes, set the proxy_max_temp_file_size to zero, or some other reasonably small value. Another option (which might be a better choice) is to set the proxy_temp_path to faster storage so that nginx can do a slightly better job of insulating the application from buggy or malicious hosts.

Upvotes: 1

Related Questions