I have raspberry pi with nginx as reverse proxy and another machine with owncloud on nginx too.

I can connect and browse in the pages but when I try to download a file that weight more than about 50mo, the download start a bit and fails.

I know the problem come from the reverse proxy, because if I access owncloud directly (locally), downloads work.

owncloud vhost :

server {
    listen 80;
    server_name cloud.spooky4672.me;
    return 301 https://$server_name$request_uri;

server {
    listen 443 ssl;
    server_name cloud.spooky4672.me;

    ssl_certificate /etc/nginx/ssl/cloud/cloud.spooky4672_chain.pem;
    ssl_certificate_key /etc/nginx/ssl/cloud/key.pem;

    access_log off;
    error_log /var/log/nginx/owncloud-error.log;

    location / {
            proxy_pass http://local_ip;


    proxy_redirect          off;
    proxy_set_header        Host            $host;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size    10m;
    client_body_buffer_size 128k;
    client_header_buffer_size 64k;
    proxy_connect_timeout   90;
    proxy_send_timeout      90;
    proxy_read_timeout      90;
    proxy_buffer_size   16k;
    proxy_buffers       32   16k;
    proxy_busy_buffers_size 64k;

migrated from serverfault.com Nov 6 '15 at 20:33

This question came from our site for system and network administrators.

  • Maybe try some real hardware instead of the RasPi. – EEAA Nov 6 '15 at 20:28
  • So we really can find troll everywhere :) – Spooky Nov 6 '15 at 20:29
  • Not trolling. You asked your question on a site for professional systems administrators, so expect to get professional-level advice. If I were in your shoes, removing the RasPi would be the first thing I'd try. – EEAA Nov 6 '15 at 20:31
  • This is just a setup for me and friends, and the pi is clearly not the problem – Spooky Nov 6 '15 at 20:32
  • Well, you haven't provided any evidence to show that. – EEAA Nov 6 '15 at 20:33

Answered on StackOverflow


client_max_body_size 1000m;

Also check out http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_max_temp_file_size

and try proxy_max_temp_file_size 0

  • It works, but the download stay a very long time at 0ko/s, weird ... – Spooky Nov 6 '15 at 21:08
  • 1
    Thanks! It was proxy_max_temp_file_size that worked for me to fix freezing large downloads. – t1m0 Jan 8 '18 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.