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

Larger client_max_body_size by default #7

Closed
GijsVermarien opened this issue May 19, 2019 · 6 comments
Closed

Larger client_max_body_size by default #7

GijsVermarien opened this issue May 19, 2019 · 6 comments

Comments

@GijsVermarien
Copy link

For the usage of Nextcloud I encountered the problem that the default client_max_body_size is not large enough, so it needs manual configuration as you shown in this gist of yours. It would be nice if this could be configured by default somehow, I now have to manually set this for the Nextcloud to work properly with anything above 1MB (which is a lot of files if you use this instead of dropbox). Is there any way to incorporate this in the .env file?

@cyr1z
Copy link

cyr1z commented Jul 23, 2019

For the usage of Nextcloud I encountered the problem that the default client_max_body_size is not large enough, so it needs manual configuration as you shown in this gist of yours. It would be nice if this could be configured by default somehow, I now have to manually set this for the Nextcloud to work properly with anything above 1MB (which is a lot of files if you use this instead of dropbox). Is there any way to incorporate this in the .env file?

Please tell me exactly how you fixed this problem. My configuration looks completely different. The client_max_body_size parameter is not found anywhere

@praetorianguards
Copy link

i fix the problem by
$ client_max_body_size 10G >/root/docker-compose-letsencrypt-nginx-proxy-companion/nginx-data/conf.d/max.conf

@sasacharle
Copy link

Can you detail the process ? I have the same pb

@kbarbora
Copy link

just to add to previous answer, the paramenters to be modified are the ones in the proxy (not the nextcloud docker instance), you can refer to the proxy repo issues for my answer or the authors answer

@MacKarp
Copy link

MacKarp commented Jun 2, 2022

I have modified nginx.tmpl from proxy. I use this only for nextcloud so if you use proxy for something different then this probably would add max file size for all services (dunno didn't test)

https://github.com/evertramos/nginx-proxy-automation/blob/master/nginx.tmpl
Added in line 254

server {
	...
	{{ end }}
	{{ $access_log }}

	client_max_body_size 10G;
	
	# Do not HTTPS redirect Let'sEncrypt ACME challenge
	location /.well-known/acme-challenge/ {
		...
	}
	...
}

and 277

server {
	...
	{{ end }}
	{{ $access_log }}

	client_max_body_size 10G;

	{{ if eq $network_tag "internal" }}
	# Only allow traffic from internal clients
	include /etc/nginx/network_internal.conf;
	{{ end }}

	...
}

Dunno if its best solution but it works for me :)

@evertramos
Copy link
Owner

Hello there!

You could reach the same result by adding this option in here:

https://github.com/evertramos/nginx-proxy-automation/blob/master/conf.d/uploadsize.conf

And start the nginx-proxy-automation with the option:

./fresh-start.sh -use-nginx-conf-files  ....

As of:

https://github.com/evertramos/nginx-proxy-automation/blob/5b66f76f29a58f2928e6b1092c66869466a11146/bin/localscript/usage-fresh-start.sh#L82

But if you already have the proxy running, you might need to do a few tricks to achieve it first.

@evertramos evertramos pinned this issue Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants