Forum: NGINX X-Accel-Buffering, proxy_buffering and proxy_store

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ab2425ae0425be8faaf052cce737b243?d=identicon&s=25 Michał Jaszczyk (Guest)
on 2009-01-05 13:18
(Received via mailing list)
Hi everyone,

I'm trying to set up safe file downloading with Nginx. My config file
stripped down to most important elements looks like this:

    upstream tempurl {
        server tempurl:8888;
    upstream storage {
        server storage:8888;
    server {
        listen 8888;
        location / {
            proxy_pass http://tempurl;
        location /storage {
            root storage_cache;
            try_files $uri @storage;
        location @storage {
            rewrite ^/storage/(.*) /$1 break;
            proxy_pass http://storage;
            proxy_store storage_cache$uri;

The idea is that a user obtains somehow a temporary URL to a file and
asks my server for it. Then my server asks the "tempurl" server to
resolve it to real file name. The "tempurl" server returns
X-Accel-Redirect header with real path to the file. The file is
located on "storage" server, so we download it from there and
simultaneously mirror it by using try_files and proxy_store

My question is: The "tempurl" server can send X-Accel-Buffering header
and I can use proxy_buffering directive. How will these two interact
with proxy_store? I'd like to avoid unnecessary disk reads/writes and
avoid blocking worker by sending response to a user with slow
connection. Where should I use buffering and where shouldn't I in the
above situation?


Ab2425ae0425be8faaf052cce737b243?d=identicon&s=25 Michał Jaszczyk (Guest)
on 2009-01-14 15:56
(Received via mailing list)

Guys, any help about this? I still haven't figured anything... I
couldn't find it in the documentation and nothing came out of trying
to read Nginx source code...

Moreover, there's another question to it: Can I use FLV module in my


This topic is locked and can not be replied to.