A
A
ArkadyBagdasarov2017-01-22 12:58:18
Nginx
ArkadyBagdasarov, 2017-01-22 12:58:18

nginx. How to specify TMP folder to proxy webdav request?

server {
    listen 80;
    server_name SITE;

    location /download {
        client_max_body_size 15g;
  client_body_temp_path /home/tmp;
        proxy_pass http://SITE/download/;
    }

}

There is a simple config for proxying. The crux of the matter is to tell nginx to put the file in /home/tmp during proxying.
There is a server1 that proxies a webdav request using the PUT method to another server2, how can the proxying server1 be told to put the file into a temporary file so as not to keep it in memory?
There is a suspicion that he (server1) should not add it, and the file flies directly from the client to the proxied server2. But it seemed to me that proxying is when the server passes through itself, and a redirect is when it redirects. I need the proxy server1 to pass through itself.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mysterion, 2017-01-22
@Mysterion

In your case, this is exactly proxying.
The only thing is that you can enable or disable data buffering so that each request is not stored in memory on the first server, but is directly forwarded to the second as requests are received.

D
Dmitry MiksIr, 2017-01-22
@miksir

Nginx reads the request body up to client_body_buffer_size into memory (16k by default). If it does not fit, it dumps all or only the excess (client_body_in_file_only) into a temporary file along the client_body_temp_path path.
This buffering can be completely disabled proxy_request_buffering.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question