Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextcloud:fpm Request Entity Too Large #95

Closed
l0calh05t opened this issue Jun 10, 2017 · 11 comments
Closed

nextcloud:fpm Request Entity Too Large #95

l0calh05t opened this issue Jun 10, 2017 · 11 comments

Comments

@l0calh05t
Copy link

l0calh05t commented Jun 10, 2017

I am running a docker-compose setup using nextcloud:fpm, nginx, nginx-proxy and docker-letsencrypt-nginx-proxy-companion (based on the example in .example, but without a non-sqlite db, redis or collabora). This works for the most part, however I cannot upload files larger than 2MB. According to #32 docker-letsencrypt-nginx-proxy-companion can cause this, but adding a client_max_body_size setting to the default or VIRTUAL_HOST-specific vhost.d files has no effect.

Could this be caused by the fast_cgi in the fpm module? I tried adding fastcgi_param PHP_VALUE "upload_max_filesize = 4000M \n post_max_size=4000M"; to the server config but this doesn't appear to have any effect either.

@SnowMB
Copy link
Contributor

SnowMB commented Jun 13, 2017

Seems like your proxy setting was fine, but the error is in the image: #97

@kunago
Copy link

kunago commented Jun 24, 2017

Using docker-compose there should be some way to overwrite the conf files but trying nearly everything I am still unable to make it work. Does anyone have a hint?

@tilosp tilosp mentioned this issue Jul 6, 2017
15 tasks
@bang-uin
Copy link

bang-uin commented Jul 28, 2017

Seems like the error is coming from the nginx proxy.

Please try to add

client_max_body_size 10G;

to the end of proxy/vhost.d/default

Restart the proxy and try to upload a > 2MB file.

@l00ptr
Copy link

l00ptr commented Aug 5, 2017

I have the same issue. It works if I add the client_max_body_size 1G; to proxy/vhost.d/default. But this file is eresased/templated if I restart the letsencrypt-companion container. Don't know where I can put some extra config for it nginx or letsencrypt container.

@bang-uin
Copy link

bang-uin commented Aug 6, 2017

Hmm, this is strange.
I have updated everything, restarted all instances and even rebooted.
My entry is still there.

@l00ptr
Copy link

l00ptr commented Aug 7, 2017

did you restart your letsencrypt-companion container?

Restarting it in my case always overwritte the default file

 % sudo cat default    
## Start of configuration add by letsencrypt contain
location /.well-known/acme-challenge/ {
    allow all;
    root /usr/share/nginx/html;
    try_files $uri =404;
    break;
}
client_max_body_size 1G;
## End of configuration add by letsencrypt container


 % sudo docker restart letsencrypt-companion
letsencrypt-companion



 % sudo cat default 
## Start of configuration add by letsencrypt container
location /.well-known/acme-challenge/ {
    allow all;
    root /usr/share/nginx/html;
    try_files $uri =404;
    break;
}
## End of configuration add by letsencrypt container

@pr4xx
Copy link

pr4xx commented Aug 8, 2017

I had the same issue and resolved it via creating a my.conf in proxy/conf.d with the following content:
client_max_body_size 10G;

@l00ptr
Copy link

l00ptr commented Aug 9, 2017

Thx @pr4xx that's almost what I did after reading the nginx docker documentation :)

@romainreignier
Copy link

@l00ptr You have to add the line from @bang-uin after the last comment about letsenscrypt otherwise it will be overwritten.

## Start of configuration add by letsencrypt contain
location /.well-known/acme-challenge/ {
    allow all;
    root /usr/share/nginx/html;
    try_files $uri =404;
    break;
}
## End of configuration add by letsencrypt container

client_max_body_size 10G;

@SnowMB
Copy link
Contributor

SnowMB commented Aug 16, 2017

You don't have to edit the default.conf. Just add another file with any name containing just the line @pr4xx posted.

uploadsize.conf:

client_max_body_size 10G;

I usally do this by mounting the extra file in docker-compose:

docker-compose.yml:

version: '3'

volumes:
  conf.d:
  vhost.d:
  html:
  certs:


services:
  proxy:
    image: jwilder/nginx-proxy:alpine
    ports:
      - 80:80
      - 443:443
    volumes:
      - conf.d:/etc/nginx/conf.d
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./uploadsize.conf:/etc/nginx/conf.d/uploadsize.conf:ro
    networks:
      - proxy-tier
    restart: always
    labels:
      - com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy

  letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - certs:/etc/nginx/certs:rw
      - conf.d:/etc/nginx/conf.d:ro
      - html:/usr/share/nginx/html:rw
      - vhost.d:/etc/nginx/vhost.d
    restart: always

networks:
  proxy-tier:

@LeConcepteur1976
Copy link

client_max_body_size 10G;

Thank you very much dud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants